/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'mongodb.aliyuncs.com',
    'cn-beijing' = 'mongodb.aliyuncs.com',
    'cn-zhangjiakou' = 'mongodb.cn-zhangjiakou.aliyuncs.com',
    'cn-huhehaote' = 'mongodb.cn-huhehaote.aliyuncs.com',
    'cn-wulanchabu' = 'mongodb.aliyuncs.com',
    'cn-hangzhou' = 'mongodb.aliyuncs.com',
    'cn-shanghai' = 'mongodb.aliyuncs.com',
    'cn-shenzhen' = 'mongodb.aliyuncs.com',
    'cn-heyuan' = 'mongodb.aliyuncs.com',
    'cn-guangzhou' = 'mongodb.aliyuncs.com',
    'cn-chengdu' = 'mongodb.cn-chengdu.aliyuncs.com',
    'cn-hongkong' = 'mongodb.cn-hongkong.aliyuncs.com',
    'ap-northeast-1' = 'mongodb.ap-northeast-1.aliyuncs.com',
    'ap-southeast-1' = 'mongodb.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'mongodb.ap-southeast-2.aliyuncs.com',
    'ap-southeast-3' = 'mongodb.ap-southeast-3.aliyuncs.com',
    'ap-southeast-5' = 'mongodb.ap-southeast-5.aliyuncs.com',
    'us-east-1' = 'mongodb.us-east-1.aliyuncs.com',
    'us-west-1' = 'mongodb.us-west-1.aliyuncs.com',
    'eu-west-1' = 'mongodb.eu-west-1.aliyuncs.com',
    'eu-central-1' = 'mongodb.eu-central-1.aliyuncs.com',
    'ap-south-1' = 'mongodb.ap-south-1.aliyuncs.com',
    'me-east-1' = 'mongodb.me-east-1.aliyuncs.com',
    'cn-hangzhou-finance' = 'mongodb.aliyuncs.com',
    'cn-shanghai-finance-1' = 'mongodb.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'mongodb.aliyuncs.com',
    'cn-north-2-gov-1' = 'mongodb.cn-north-2-gov-1.aliyuncs.com',
    'ap-northeast-2-pop' = 'mongodb.aliyuncs.com',
    'cn-beijing-finance-1' = 'mongodb.aliyuncs.com',
    'cn-beijing-finance-pop' = 'mongodb.aliyuncs.com',
    'cn-beijing-gov-1' = 'mongodb.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'mongodb.aliyuncs.com',
    'cn-edge-1' = 'mongodb.aliyuncs.com',
    'cn-fujian' = 'mongodb.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'mongodb.aliyuncs.com',
    'cn-hangzhou-test-306' = 'mongodb.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'mongodb.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'mongodb.aliyuncs.com',
    'cn-qingdao-nebula' = 'mongodb.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'mongodb.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'mongodb.aliyuncs.com',
    'cn-shanghai-inner' = 'mongodb.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'mongodb.aliyuncs.com',
    'cn-shenzhen-inner' = 'mongodb.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'mongodb.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'mongodb.aliyuncs.com',
    'cn-wuhan' = 'mongodb.aliyuncs.com',
    'cn-yushanfang' = 'mongodb.aliyuncs.com',
    'cn-zhangbei' = 'mongodb.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'mongodb.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'mongodb.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'mongodb.aliyuncs.com',
    'eu-west-1-oxs' = 'mongodb.aliyuncs.com',
    'rus-west-1-pop' = 'mongodb.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('dds', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AllocateNodePrivateNetworkAddressRequest {
  accountName?: string(name='AccountName', description='The username of the account.

> 

*   The username must be 4 to 16 characters in length and can contain lowercase letters, digits, and underscores (_). The username must start with a lowercase letter.

*   You must configure the account and password only when you apply for the endpoint of a shard or Configserver node for the first time. The account and password are required for all shard and Configserver nodes.

*   The permissions of this account are fixed to read-only.', example='shardcsaccount'),
  accountPassword?: string(name='AccountPassword', description='The password for the account.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `! # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.', example='Test123456'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the sharded cluster instance.

This parameter is required.', example='dds-bp1fa5efaa93****'),
  nodeId?: string(name='NodeId', description='The ID of the shard or Configserver node.

>  You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the ID of the shard or Configserver node.

This parameter is required.', example='d-bp124beeb0ac****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  zoneId?: string(name='ZoneId', description='The ID of the zone to which the instance belongs.

>  You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the zone ID of the instance.', example='cn-hangzhou-b'),
}

model AllocateNodePrivateNetworkAddressResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='60EEBD77-227C-5B39-86EA-D89163C5****'),
}

model AllocateNodePrivateNetworkAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateNodePrivateNetworkAddressResponseBody(name='body'),
}

/**
 * @summary Applies for an internal endpoint for a shard or Configserver node in an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description This operation is applicable only to sharded cluster instances. For more information, see [Apply for an endpoint for a shard or Configserver node](https://help.aliyun.com/document_detail/134037.html).
 * >  The allocated endpoints can be used only for internal access. To gain Internet access, you must call the [AllocatePublicNetworkAddress](https://help.aliyun.com/document_detail/67602.html) operation to apply for public endpoints.
 *
 * @param request AllocateNodePrivateNetworkAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateNodePrivateNetworkAddressResponse
 */
async function allocateNodePrivateNetworkAddressWithOptions(request: AllocateNodePrivateNetworkAddressRequest, runtime: Util.RuntimeOptions): AllocateNodePrivateNetworkAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllocateNodePrivateNetworkAddress',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies for an internal endpoint for a shard or Configserver node in an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description This operation is applicable only to sharded cluster instances. For more information, see [Apply for an endpoint for a shard or Configserver node](https://help.aliyun.com/document_detail/134037.html).
 * >  The allocated endpoints can be used only for internal access. To gain Internet access, you must call the [AllocatePublicNetworkAddress](https://help.aliyun.com/document_detail/67602.html) operation to apply for public endpoints.
 *
 * @param request AllocateNodePrivateNetworkAddressRequest
 * @return AllocateNodePrivateNetworkAddressResponse
 */
async function allocateNodePrivateNetworkAddress(request: AllocateNodePrivateNetworkAddressRequest): AllocateNodePrivateNetworkAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateNodePrivateNetworkAddressWithOptions(request, runtime);
}

model AllocatePublicNetworkAddressRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance

> If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp11483712c1****'),
  nodeId?: string(name='NodeId', description='The ID of the mongos, shard, or Configserver node in the sharded cluster instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the ID of the mongos, shard, or Configserver node.

> This parameter is required only when you specify the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='s-bp18e6d84ae3****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AllocatePublicNetworkAddressResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='8AA45036-497F-52E7-B951-F9C7B239****'),
}

model AllocatePublicNetworkAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocatePublicNetworkAddressResponseBody(name='body'),
}

/**
 * @summary Allocates a public endpoint to an instance.
 *
 * @param request AllocatePublicNetworkAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocatePublicNetworkAddressResponse
 */
async function allocatePublicNetworkAddressWithOptions(request: AllocatePublicNetworkAddressRequest, runtime: Util.RuntimeOptions): AllocatePublicNetworkAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllocatePublicNetworkAddress',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Allocates a public endpoint to an instance.
 *
 * @param request AllocatePublicNetworkAddressRequest
 * @return AllocatePublicNetworkAddressResponse
 */
async function allocatePublicNetworkAddress(request: AllocatePublicNetworkAddressRequest): AllocatePublicNetworkAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocatePublicNetworkAddressWithOptions(request, runtime);
}

model CheckCloudResourceAuthorizedRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp18f7d6b6a7****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  targetRegionId?: string(name='TargetRegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
}

model CheckCloudResourceAuthorizedResponseBody = {
  authorizationState?: int32(name='AuthorizationState', description='Indicates whether KMS keys are authorized to ApsaraDB for MongoDB instances. Valid values:

*   **0**: KMS keys are not authorized.
*   **1**: KMS keys are authorized.
*   **2**: KMS is not enabled.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A0181AC4-F186-46ED-87CA-100C70B86729'),
  roleArn?: string(name='RoleArn', description='The role information of the authorized Alibaba Resource Name (ARN).

>  This parameter is returned only when the value of the **AuthorizationState** parameter is **1**.', example='acs:ram::140****:role/aliyunrdsinstanceencryptiondefaultrole'),
}

model CheckCloudResourceAuthorizedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCloudResourceAuthorizedResponseBody(name='body'),
}

/**
 * @summary You can call this operation to check whether KMS keys are authorized to ApsaraDB for MongoDB instances.
 *
 * @description Before you enable Transparent Data Encryption (TDE) by calling the [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html) operation, you can call this operation to check whether KMS keys are authorized to ApsaraDB for MongoDB instances.
 *
 * @param request CheckCloudResourceAuthorizedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorizedWithOptions(request: CheckCloudResourceAuthorizedRequest, runtime: Util.RuntimeOptions): CheckCloudResourceAuthorizedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.targetRegionId)) {
    query['TargetRegionId'] = request.targetRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckCloudResourceAuthorized',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to check whether KMS keys are authorized to ApsaraDB for MongoDB instances.
 *
 * @description Before you enable Transparent Data Encryption (TDE) by calling the [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html) operation, you can call this operation to check whether KMS keys are authorized to ApsaraDB for MongoDB instances.
 *
 * @param request CheckCloudResourceAuthorizedRequest
 * @return CheckCloudResourceAuthorizedResponse
 */
async function checkCloudResourceAuthorized(request: CheckCloudResourceAuthorizedRequest): CheckCloudResourceAuthorizedResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkCloudResourceAuthorizedWithOptions(request, runtime);
}

model CheckRecoveryConditionRequest {
  backupId?: string(name='BackupId', description='The backup ID.

> *   You can call the [DescribeBackups](https://help.aliyun.com/document_detail/62172.html) operation to query the backup ID.
> *   You must specify one of the **RestoreTime** and BackupId parameters.
> *   This parameter is not applicable to sharded cluster instances.', example='5664****'),
  databaseNames?: string(name='DatabaseNames', description='The name of the source database. The value is a JSON array.

>  If you do not specify this parameter, all databases are restored by default.', example='["db1","db2"]'),
  destRegion?: string(name='DestRegion', description='The region of the backup set used for the cross-region backup and restoration.

>  This parameter is required when you set the RestoreType parameter to 3.', example='cn-hangzhou'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.2'),
  instanceType?: string(name='InstanceType', description='The instance architecture. Valid values:

*   replicate
*   sharding

> * This parameter is required when you set the RestoreType parameter to 2.
> * This parameter is required when you set the RestoreType parameter to 3.', example='replicate'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='sg-bp179****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='The point in time to which the instance is restored. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> *   The time can be a point in time within the past seven days. The time must be earlier than the current time, but later than the time when the instance was created.
> *   You must specify one of the RestoreTime and **BackupId** parameters.', example='2022-08-22T08:00:00Z'),
  restoreType?: string(name='RestoreType', description='The restoration type.

> * 0: The data of the source instance is restored to a new instance in the same region.
> * 1: The data of the source instance is restored to an earlier point in time.
> * 2: The data of a deleted instance is restored to a new instance from the backup set.
> * 3: The data of a deleted instance is restored to a new instance in another region from the backup set.', example='0'),
  sourceDBInstance?: string(name='SourceDBInstance', description='The ID of the source instance.', example='dds-bp1378****'),
  srcRegion?: string(name='SrcRegion', description='The region where the source instance resides.

> * This parameter is required when you set the RestoreType parameter to 2.
> * This parameter is required when you set the RestoreType parameter to 3.', example='cn-beijing'),
}

model CheckRecoveryConditionResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', description='The instance ID', example='dds-bp1378****'),
  isValid?: boolean(name='IsValid', description='Indicates whether the data of the instance can be restored. Valid values:

*   **true**: The data of the instance can be restored.
*   **false**: The data of the instance cannot be restored.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='D563A3E7-6010-45FE-A0CD-9283414C9657'),
}

model CheckRecoveryConditionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckRecoveryConditionResponseBody(name='body'),
}

/**
 * @summary Queries whether the data of an ApsaraDB for MongoDB instance can be restored.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances.
 * >  After you call this operation to confirm that the data of the instance can be restored, you can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation to restore data to a new instance.
 *
 * @param request CheckRecoveryConditionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckRecoveryConditionResponse
 */
async function checkRecoveryConditionWithOptions(request: CheckRecoveryConditionRequest, runtime: Util.RuntimeOptions): CheckRecoveryConditionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.databaseNames)) {
    query['DatabaseNames'] = request.databaseNames;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.sourceDBInstance)) {
    query['SourceDBInstance'] = request.sourceDBInstance;
  }
  if (!Util.isUnset(request.sourceDBInstance)) {
    query['SourceDBInstance'] = request.sourceDBInstance;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckRecoveryCondition',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether the data of an ApsaraDB for MongoDB instance can be restored.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances.
 * >  After you call this operation to confirm that the data of the instance can be restored, you can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation to restore data to a new instance.
 *
 * @param request CheckRecoveryConditionRequest
 * @return CheckRecoveryConditionResponse
 */
async function checkRecoveryCondition(request: CheckRecoveryConditionRequest): CheckRecoveryConditionResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkRecoveryConditionWithOptions(request, runtime);
}

model CheckServiceLinkedRoleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
}

model CheckServiceLinkedRoleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='7BE0D8D2-6702-5639-A9C2-xxxxxxx'),
  serviceLinkedRoleExists?: boolean(name='ServiceLinkedRoleExists', description='Indicates whether an SLR is created.', example='True'),
}

model CheckServiceLinkedRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckServiceLinkedRoleResponseBody(name='body'),
}

/**
 * @summary Queries whether a service-linked role is created.
 *
 * @param request CheckServiceLinkedRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRoleWithOptions(request: CheckServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CheckServiceLinkedRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckServiceLinkedRole',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether a service-linked role is created.
 *
 * @param request CheckServiceLinkedRoleRequest
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRole(request: CheckServiceLinkedRoleRequest): CheckServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkServiceLinkedRoleWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountName?: string(name='AccountName', description='The name of the database account. The name must be 4 to 16 characters in length. It can contain lowercase letters, digits, and underscores (_). It must start with a lowercase letter. The account is granted read-only permissions.

This parameter is required.', example='admin1'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account. The password must be 8 to 32 characters in length. It can contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. Special characters include ! # $ % ^ & \\\\* ( ) _ + - =

This parameter is required.', example='Test123456!'),
  characterType?: string(name='CharacterType', description='The type of the account that you want to create. Valid values:

*   **db** (default): shard account (available)
*   **cs**: ConfigServer account
*   **normal**: replica set account

>  You can set this parameter only to **db**.', example='db'),
  DBInstanceId?: string(name='DBInstanceId', description='The cluster ID.

This parameter is required.', example='dds-uf6e9433e955xxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateAccountResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='7FEF1BEF-2842-5758-9126-415A297XXXXX'),
}

model CreateAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccountResponseBody(name='body'),
}

/**
 * @summary Creates an account that is granted read-only permissions for shard nodes in an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description *   You can create an account for shard nodes only in an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 * *   The account is granted read-only permissions.
 *
 * @param request CreateAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccountResponse
 */
async function createAccountWithOptions(request: CreateAccountRequest, runtime: Util.RuntimeOptions): CreateAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccount',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an account that is granted read-only permissions for shard nodes in an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description *   You can create an account for shard nodes only in an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 * *   The account is granted read-only permissions.
 *
 * @param request CreateAccountRequest
 * @return CreateAccountResponse
 */
async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateBackupRequest {
  backupMethod?: string(name='BackupMethod', description='The backup method of the instance. Valid values:

*   **Logical**
*   **Physical** (default)

> Only replica set instances and sharded cluster instances support this parameter. You do not need to specify this parameter for standalone instances. All standalone instances use snapshot backup.', example='Logical'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='d-bp2235****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateBackupResponseBody = {
  backupId?: string(name='BackupId', description='The ID of the backup set.', example='5664****'),
  requestId?: string(name='RequestId', description='The request ID.', example='7016B12F-7F64-40A4-BAFF-013F02AC82FC'),
}

model CreateBackupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateBackupResponseBody(name='body'),
}

/**
 * @summary Creates a backup set for an ApsaraDB for MongoDB instance.
 *
 * @description When you call this operation, the instance must be in the Running state.
 *
 * @param request CreateBackupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateBackupResponse
 */
async function createBackupWithOptions(request: CreateBackupRequest, runtime: Util.RuntimeOptions): CreateBackupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupMethod)) {
    query['BackupMethod'] = request.backupMethod;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateBackup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a backup set for an ApsaraDB for MongoDB instance.
 *
 * @description When you call this operation, the instance must be in the Running state.
 *
 * @param request CreateBackupRequest
 * @return CreateBackupResponse
 */
async function createBackup(request: CreateBackupRequest): CreateBackupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBackupWithOptions(request, runtime);
}

model CreateDBInstanceRequest {
  accountPassword?: string(name='AccountPassword', description='The password of the root account. The password must meet the following requirements:

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include ! # $ % ^ & \\\\* ( ) _ + - =
*   The password of the account must be 8 to 32 characters in length.', example='123456Aa'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Default value: false. Valid values:

*   **true**: The instance is automatically renewed.
*   **false**: The instance is manually renewed.

> This parameter is valid and optional when the **ChargeType** parameter is set to **PrePaid**.', example='true'),
  backupId?: string(name='BackupId', description='The ID of the backup set. You can call the [DescribeBackups](https://help.aliyun.com/document_detail/62172.html) operation to query the backup set ID.

> When you call this operation to clone an instance based on the backup set, this parameter is required. The **SrcDBInstanceId** parameter is also required.', example='32994****'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PostPaid**: pay-as-you-go. This is the default value.
*   **PrePaid**: subscription.

> If you set this parameter to **PrePaid**, you must also specify the **Period** parameter.', example='PrePaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  clusterId?: string(name='ClusterId', description='The ID of the dedicated cluster to which the instance belongs.', example='dhg-2x78****'),
  couponNo?: string(name='CouponNo', description='Specifies whether to use coupons. Default value: null. Valid values:
- **default** or **null**: uses coupons.
- **youhuiquan_promotion_option_id_for_blank**: does not use coupons.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The instance type. You can also call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/149719.html) operation to query the instance type.

This parameter is required.', example='dds.mongo.standard'),
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The name of the instance. The name of the instance must meet the following requirements:

*   The name must start with a letter.
*   The name can contain digits, letters, underscores (_), and hyphens (-).
*   The name must be 2 to 256 characters in length.', example='test'),
  DBInstanceStorage?: int32(name='DBInstanceStorage', description='The storage capacity of the instance. Unit: GB.

The values that can be specified for this parameter vary based on the instance types. For more information, see [Replica set instance types](https://help.aliyun.com/document_detail/311410.html).

This parameter is required.', example='10'),
  databaseNames?: string(name='DatabaseNames', description='The name of the database.

> When you call this operation to clone an instance, you can set this parameter to specify the database to clone. Otherwise, all databases of the instance are cloned.', example='mongodbtest'),
  encrypted?: boolean(name='Encrypted', description='Specifies whether to enable disk encryption.', example='true'),
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key.', example='2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.', example='MongoDB'),
  engineVersion?: string(name='EngineVersion', description='The version of the database engine. Valid values:

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**

> When you call this operation to clone an instance or restore an instance from the recycle bin, set the value of this parameter to the engine version of the source instance.

This parameter is required.', example='4.4'),
  globalSecurityGroupIds?: string(name='GlobalSecurityGroupIds', description='The global IP address whitelist template name of the instance. Multiple IP address whitelist template names are separated by commas (,) and each template name must be unique. (The template feature is available only in canary release.)', example='g-qxieqf40xjst1ngp****'),
  hiddenZoneId?: string(name='HiddenZoneId', description='The zone where the hidden node resides for multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G.
*   **cn-hangzhou-h**: Hangzhou Zone H.
*   **cn-hangzhou-i**: Hangzhou Zone I.
*   **cn-hongkong-b**: Hongkong Zone B.
*   **cn-hongkong-c**: Hongkong Zone C.
*   **cn-hongkong-d**: Hongkong Zone D.
*   **cn-wulanchabu-a**: Ulanqab Zone A.
*   **cn-wulanchabu-b**: Ulanqab Zone B.
*   **cn-wulanchabu-c**: Ulanqab Zone C.
*   **ap-southeast-1a**: Singapore Zone A.
*   **ap-southeast-1b**: Singapore Zone B.
*   **ap-southeast-1c**: Singapore Zone C.
*   **ap-southeast-5a**: Jakarta Zone A.
*   **ap-southeast-5b**: Jakarta Zone B.
*   **ap-southeast-5c**: Jakarta Zone C.
*   **eu-central-1a**: Frankfurt Zone A.
*   **eu-central-1b**: Frankfurt Zone B.
*   **eu-central-1c**: Frankfurt Zone C.

>  *   This parameter is valid and required when the **EngineVersion** parameter is set to **4.4** or **5.0**.
>  *   The value of this parameter cannot be the same as the value of the **ZoneId** or **SecondaryZoneId** parameter.', example='cn-hangzhou-i'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Valid value:

**VPC**: Virtual Private Cloud (VPC)', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period', description='The subscription period of the instance. Unit: months.

Valid values: **1** to **9**, **12**, **24**, **36**, and **60**.

> When you set the **ChargeType** parameter to **PrePaid**, this parameter is valid and required.', example='1'),
  provisionedIops?: long(name='ProvisionedIops', description='The provisioned IOPS. Valid values: 0 to 50000.', example='1960'),
  readonlyReplicas?: string(name='ReadonlyReplicas', description='The number of **read-only nodes** in the replica set instance. Default value: **0**. Valid values: **0** to **5**.', example='0'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of **nodes** in the replica set instance. Default value: 3. Valid values:

*   **3**
*   **5**
*   **7**', example='3'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='The point in time to which the instance is restored, which must be within seven days. The time is displayed in the *yyyy-MM-dd*T*HH:mm:ss*Z format (UTC time).

> When you call this operation to restore an instance to the specified time, this parameter is required. The **SrcDBInstanceId** parameter is also required.', example='2022-03-13T12:11:14Z'),
  restoreType?: string(name='RestoreType', description='The backup restore type of the instance.
- 0: restore an instance to the specified backup set.
- 1:  restore an instance to the specified time.
- 2: restore an  released instance to the specified backup set.
- 3：restore an instance to the specified cross-regional backup set.', example='0'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The zone where the secondary node resides for multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G.
*   **cn-hangzhou-h**: Hangzhou Zone H.
*   **cn-hangzhou-i**: Hangzhou Zone I.
*   **cn-hongkong-b**: Hongkong Zone B.
*   **cn-hongkong-c**: Hongkong Zone C.
*   **cn-hongkong-d**: Hongkong Zone D.
*   **cn-wulanchabu-a**: Ulanqab Zone A.
*   **cn-wulanchabu-b**: Ulanqab Zone B.
*   **cn-wulanchabu-c**: Ulanqab Zone C.
*   **ap-southeast-1a**: Singapore Zone A.
*   **ap-southeast-1b**: Singapore Zone B.
*   **ap-southeast-1c**: Singapore Zone C.
*   **ap-southeast-5a**: Jakarta Zone A.
*   **ap-southeast-5b**: Jakarta Zone B.
*   **ap-southeast-5c**: Jakarta Zone C.
*   **eu-central-1a**: Frankfurt Zone A.
*   **eu-central-1b**: Frankfurt Zone B.
*   **eu-central-1c**: Frankfurt Zone C.

>  *   This parameter is valid and required when the **EngineVersion** parameter is set to **4.4** or **5.0**.
>  *   The value of this parameter cannot be the same as the value of the **ZoneId** or **HiddenZoneId** parameter.', example='cn-hangzhou-h'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in an IP address whitelist. Multiple IP addresses are separated by commas (,), and each IP address in the IP address whitelist must be unique. The following types of values are supported:

*   0.0.0.0/0
*   IP addresses, such as 10.23.12.24.
*   Classless Inter-Domain Routing (CIDR) blocks, such as 10.23.12.0/24. In this case, /24 indicates that the prefix of each IP address is 24-bit long. You can replace 24 with a value within the range of 1 to 32.

> *   A maximum of 1,000 IP addresses or CIDR blocks can be configured for each instance.
> *   If you enter 0.0.0.0/0, all IP addresses can access the instance. This may introduce security risks to the instance. Proceed with caution.', example='192.168.xx.xx,192.168.xx.xx'),
  srcDBInstanceId?: string(name='SrcDBInstanceId', description='The ID of the source instance.

> When you call this operation to clone an instance, this parameter is required. The **BackupId** or **RestoreTime** parameter is also required. When you call this operation to restore an instance from the recycle bin, this parameter is required. The **BackupId** or **RestoreTime** parameter is not required.', example='dds-bp1ee12ad351****'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.

> -  This parameter is required when restore type is set to 2 or 3.', example='2'),
  storageEngine?: string(name='StorageEngine', description='The storage engine of the instance. Set the value to **WiredTiger**.

> * If you call this operation to clone an instance or restore an instance from the recycle bin, set this parameter to the storage engine of the source instance.
> * For more information about the limits on database versions and storage engines of an instance, see [MongoDB versions and storage engines](https://help.aliyun.com/document_detail/61906.html).', example='WiredTiger'),
  storageType?: string(name='StorageType', description='The storage type of the instance. Valid values:

*   **cloud_essd1** :ESSD PL1.
*   **cloud_essd2**: ESSD PL2.
*   **cloud_essd3**: ESSD PL3.
*   **local_ssd**: local SSD.', example='cloud_essd1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag.

> **N** specifies the serial number of the tag. For example, **Tag.1.Key** specifies the key of the first tag and **Tag.2.Key** specifies the key of the second tag.', example='testdatabase'),
      value?: string(name='Value', description='The value of the tag.

> **N** specifies the serial number of the tag. For example, **Tag.1.Value** specifies the value of the first tag and **Tag.2.Value** specifies the value of the second tag.', example='apitest'),
    }
  ](name='Tag', description='The custom tags added to the instance.'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch to which the instance is connected.', example='vsw-bp1gzt31twhlo0sa5****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent zone list.', example='cn-hangzhou-g'),
}

model CreateDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.', example='dds-bp144a7f2db8****'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='21077576248****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D8F1D721-6439-4257-A89C-F1E8E9C9****'),
}

model CreateDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBInstanceResponseBody(name='body'),
}

/**
 * @summary Creates or clones an ApsaraDB for MongoDB replica set instance.
 *
 * @description Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * For more information about the instance types of ApsaraDB for MongoDB instances, see [Instance types](https://www.alibabacloud.com/help/en/mongodb/product-overview/instance-types-1).
 * To create sharded cluster instances, you can call the [CreateShardingDBInstance](~~CreateShardingDBInstance~~) operation.
 *
 * @param request CreateDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBInstanceResponse
 */
async function createDBInstanceWithOptions(request: CreateDBInstanceRequest, runtime: Util.RuntimeOptions): CreateDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.DBInstanceStorage)) {
    query['DBInstanceStorage'] = request.DBInstanceStorage;
  }
  if (!Util.isUnset(request.databaseNames)) {
    query['DatabaseNames'] = request.databaseNames;
  }
  if (!Util.isUnset(request.encrypted)) {
    query['Encrypted'] = request.encrypted;
  }
  if (!Util.isUnset(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.globalSecurityGroupIds)) {
    query['GlobalSecurityGroupIds'] = request.globalSecurityGroupIds;
  }
  if (!Util.isUnset(request.hiddenZoneId)) {
    query['HiddenZoneId'] = request.hiddenZoneId;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.provisionedIops)) {
    query['ProvisionedIops'] = request.provisionedIops;
  }
  if (!Util.isUnset(request.readonlyReplicas)) {
    query['ReadonlyReplicas'] = request.readonlyReplicas;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!Util.isUnset(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  if (!Util.isUnset(request.srcDBInstanceId)) {
    query['SrcDBInstanceId'] = request.srcDBInstanceId;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  if (!Util.isUnset(request.storageEngine)) {
    query['StorageEngine'] = request.storageEngine;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates or clones an ApsaraDB for MongoDB replica set instance.
 *
 * @description Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * For more information about the instance types of ApsaraDB for MongoDB instances, see [Instance types](https://www.alibabacloud.com/help/en/mongodb/product-overview/instance-types-1).
 * To create sharded cluster instances, you can call the [CreateShardingDBInstance](~~CreateShardingDBInstance~~) operation.
 *
 * @param request CreateDBInstanceRequest
 * @return CreateDBInstanceResponse
 */
async function createDBInstance(request: CreateDBInstanceRequest): CreateDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBInstanceWithOptions(request, runtime);
}

model CreateGlobalSecurityIPGroupRequest {
  GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

> Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP address whitelists.

This parameter is required.', example='27.18.86.18,183.92.40.129'),
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   It can contain lowercase letters, digits, and underscores (_).
*   It must start with a letter and end with a letter or digit.
*   It must be 2 to 120 characters in length.

This parameter is required.', example='aizy'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CreateGlobalSecurityIPGroupResponseBody = {
  globalSecurityIPGroup?: [ 
    {
      GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

> Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP address whitelists.', example='111.207.194.217,61.149.7.154'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   It can contain lowercase letters, digits, and underscores (_).
*   It must start with a letter and end with a letter or digit.
*   It must be 2 to 120 characters in length.', example='developer'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-2ifynl1jfkdlhhxgva3q'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
    }
  ](name='GlobalSecurityIPGroup', description='The IP whitelist templates.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8CA8312-530A-413A-9129-F2BB32A8D404'),
}

model CreateGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Creates a global IP whitelist template.
 *
 * @param request CreateGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGlobalSecurityIPGroupResponse
 */
async function createGlobalSecurityIPGroupWithOptions(request: CreateGlobalSecurityIPGroupRequest, runtime: Util.RuntimeOptions): CreateGlobalSecurityIPGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.GIpList)) {
    query['GIpList'] = request.GIpList;
  }
  if (!Util.isUnset(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGlobalSecurityIPGroup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a global IP whitelist template.
 *
 * @param request CreateGlobalSecurityIPGroupRequest
 * @return CreateGlobalSecurityIPGroupResponse
 */
async function createGlobalSecurityIPGroup(request: CreateGlobalSecurityIPGroupRequest): CreateGlobalSecurityIPGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGlobalSecurityIPGroupWithOptions(request, runtime);
}

model CreateNodeRequest {
  accountName?: string(name='AccountName', description='The username of the account. The username must meet the following requirements:

*   The username starts with a lowercase letter.
*   The username can contain lowercase letters, digits, and underscores (_).
*   The username must be 4 to 16 characters in length.

> 

*   Keywords cannot be used as accounts.

*   This account is granted the read-only permissions.
*   The username and password need to be set if you apply for an endpoint for the shard node for the first time.', example='ceshi'),
  accountPassword?: string(name='AccountPassword', description='The password of the account. The password must meet the following requirements:

*   The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   These special characters include ! @ # $ % ^ & \\\\* ( ) _ + - =
*   The password is 8 to 32 characters in length.

>  ApsaraDB for MongoDB does not allow you to reset the password of an account.', example='123+abc'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true** (default): enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. You can perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, choose **Expenses** > Orders. On the **Orders** page, find the order that you want to pay for and complete the payment.

>  This parameter is required only when the billing method of the instance is subscription.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the generated token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: **youhuiquan_promotion_option_id_for_blank**.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the sharded cluster instance.

This parameter is required.', example='dds-bp11501cd7b5****'),
  nodeClass?: string(name='NodeClass', description='The instance type of the shard or mongos node. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html).

This parameter is required.', example='dds.shard.mid'),
  nodeStorage?: int32(name='NodeStorage', description='The disk capacity of the node. Unit: GB.

Valid values: **10** to **2000**. The value must be a multiple of 10.

>  This parameter is required only when the NodeType parameter is set to **shard**.', example='10'),
  nodeType?: string(name='NodeType', description='The type of the node. Valid values:

*   **shard**: shard node
*   **mongos**: mongos node

This parameter is required.', example='shard'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard node.

Valid values: **0**, 1, 2, 3, 4, and **5**. Default value: **0**.

>  This parameter is available only for ApsaraDB for MongoDB instances that are purchased on the China site (aliyun.com).', example='5'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  shardDirect?: boolean(name='ShardDirect', description='Specifies whether to apply for an endpoint for the shard node. Valid values:

*   **true**: applies for an endpoint for the shard node.
*   **false** (default): does not apply for an endpoint for the shard node.', example='false'),
}

model CreateNodeResponseBody = {
  nodeId?: string(name='NodeId', description='The node ID.', example='d-bp1b234bf7a4****'),
  orderId?: string(name='OrderId', description='The order ID.', example='20951063702****'),
  requestId?: string(name='RequestId', description='The request ID.', example='7D48FB19-20CA-4725-A870-3D8F5CE6****'),
}

model CreateNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNodeResponseBody(name='body'),
}

/**
 * @summary Adds a shard or mongos node to an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * This operation applies only to sharded cluster instances.
 *
 * @param request CreateNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNodeResponse
 */
async function createNodeWithOptions(request: CreateNodeRequest, runtime: Util.RuntimeOptions): CreateNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeClass)) {
    query['NodeClass'] = request.nodeClass;
  }
  if (!Util.isUnset(request.nodeStorage)) {
    query['NodeStorage'] = request.nodeStorage;
  }
  if (!Util.isUnset(request.nodeType)) {
    query['NodeType'] = request.nodeType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.readonlyReplicas)) {
    query['ReadonlyReplicas'] = request.readonlyReplicas;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.shardDirect)) {
    query['ShardDirect'] = request.shardDirect;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNode',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds a shard or mongos node to an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * This operation applies only to sharded cluster instances.
 *
 * @param request CreateNodeRequest
 * @return CreateNodeResponse
 */
async function createNode(request: CreateNodeRequest): CreateNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNodeWithOptions(request, runtime);
}

model CreateNodeBatchRequest {
  accountName?: string(name='AccountName', description='The username of the account. The username must meet the following requirements:
- The username starts with a lowercase letter. 
- The username contains lowercase letters, digits, and underscores (_). 
- The username is 4 to 16 characters in length. 

> - Keywords cannot be used as account usernames. 
> - The permissions of this account are fixed at read-only. 
> - The username and password are required to be set only when you apply for an endpoint for the shard node for the first time.', example='ceshi'),
  accountPassword?: string(name='AccountPassword', description='The password of the account. The password must meet the following requirements:
- The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and specific special characters. 
- These special characters include ! @ # $ % ^ & * ( ) _ + - = 
- The password is 8 to 32 characters in length. 
> The account password of the shard node cannot be reset.', example='123+abc'),
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Default value: true. Valid values:
- **true**: enables automatic payment. Make sure that you have sufficient balance within your account. 
- **false**: disables automatic payment. In this case, you must manually pay for the instance. You can perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, choose **Expenses** > **Orders**. On the Orders page, find the order and complete the payment.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information.', example='{“ActivityId":"000000000"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', description='Specifies whether to use coupons. Default value: null. Valid values:

*   **default** or **null**: uses coupons.
*   **youhuiquan_promotion_option_id_for_blank**: does not use coupons.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance for which you want to add nodes.

This parameter is required.', example='dds-bp18b0934e70****'),
  fromApp?: string(name='FromApp', description='The source of the request. Valid values:
- **OpenApi**: ApsaraDB for MongoDB API 
- **mongo_buy**: ApsaraDB for MongoDB console', example='OpenApi'),
  nodesInfo?: string(name='NodesInfo', description='The specifications of the mongos or shard node that you want to add. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html). 

> Up to 32 mongos or shard nodes are supported for each sharded cluster instance.

This parameter is required.', example='{"Shards":[{"DBInstanceClass":"mdb.shard.4x.large.d","Storage":20}]}'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  shardDirect?: boolean(name='ShardDirect', description='Specifies whether to apply for an endpoint for the shard node. Default value: false. Valid values:
- **true**: applies for an endpoint for the shard node. 
- **false**: does not apply for an endpoint for the shard node.', example='false'),
}

model CreateNodeBatchResponseBody = {
  nodeId?: string(name='NodeId', description='The ID of the added mongos or shard node.', example='d-bp18f7d6b6a7****'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='50179021707****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='55D41A94-1ACE-55E8-8BC7-67D622E7****'),
}

model CreateNodeBatchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateNodeBatchResponseBody(name='body'),
}

/**
 * @summary Batch adds mongos or shard nodes for a sharded cluster instance.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB. 
 * This operation is applicable only to sharded cluster instances.
 *
 * @param request CreateNodeBatchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateNodeBatchResponse
 */
async function createNodeBatchWithOptions(request: CreateNodeBatchRequest, runtime: Util.RuntimeOptions): CreateNodeBatchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.fromApp)) {
    query['FromApp'] = request.fromApp;
  }
  if (!Util.isUnset(request.nodesInfo)) {
    query['NodesInfo'] = request.nodesInfo;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.shardDirect)) {
    query['ShardDirect'] = request.shardDirect;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateNodeBatch',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Batch adds mongos or shard nodes for a sharded cluster instance.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB. 
 * This operation is applicable only to sharded cluster instances.
 *
 * @param request CreateNodeBatchRequest
 * @return CreateNodeBatchResponse
 */
async function createNodeBatch(request: CreateNodeBatchRequest): CreateNodeBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return createNodeBatchWithOptions(request, runtime);
}

model CreateShardingDBInstanceRequest {
  accountPassword?: string(name='AccountPassword', description='The password of the root account. The password must meet the following requirements:

*   The password contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   The following special characters are supported: ! @ # $ % ^ & \\\\* ( ) _ + - =.
*   The password must be 8 to 32 characters in length.

>  For more information about how to resolve failed database connections due to special characters, see [What do I do if my instance is not connected due to special characters in the password in the connection string of the instance?](https://help.aliyun.com/document_detail/471568.html)', example='123456Aa'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**
*   **false** (default)

> This parameter is available and optional if you set the value of **ChargeType** to **PrePaid**.', example='true'),
  backupId?: string(name='BackupId', description='The ID of the backup set. 

> When you call this operation to clone an instance based on the backup set, this parameter is required. The **SrcDBInstanceId** parameter is also required.', example='cb-xxx'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PostPaid** (default): pay-as-you-go
*   **PrePaid**: subscription

>  If you set this parameter to **PrePaid**, you must also configure the **Period** parameter.', example='PrePaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  configServer?: [ 
    {
      class?: string(name='Class', description='The instance type of the ConfigServer node. Valid values:

*   **mdb.shard.2x.xlarge.d**: 4 cores, 8 GB (dedicated). Only instances that run MongoDB 4.4 and later support this instance type.
*   **dds.cs.mid** :1 core, 2 GB (general-purpose). Only instances that run MongoDB 4.2 and earlier support this instance type.

This parameter is required.', example='mdb.shard.2x.xlarge.d'),
      storage?: int32(name='Storage', description='The storage space of the ConfigServer node. Unit: GB.

> The values that can be specified for this parameter vary based on the instance types. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).

This parameter is required.', example='20'),
    }
  ](name='ConfigServer', description='The ConfigServer nodes of the instance.

This parameter is required.'),
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The name of the instance. The name of the instance must meet the following requirements:

*   The name must start with a letter.
*   It can contain digits, letters, underscores (_), and hyphens (-).
*   It must be 2 to 256 characters in length.', example='test'),
  destRegion?: string(name='DestRegion', description='The region of the backup set used for the cross-region backup and restoration.

>  This parameter is required when you set the RestoreType parameter to 3.', example='cn-hangzhou'),
  encrypted?: boolean(name='Encrypted', description='Specifies whether to enable disk encryption.', example='true'),
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key.', example='2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.

This parameter is required.', example='MongoDB'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values:

*   **7.0**
*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**

> 

*   For more information about the limits on database versions and storage engines, see [MongoDB versions and storage engines](https://help.aliyun.com/document_detail/61906.html).

*   If you call this operation to clone an instance, set the value of this parameter to the database engine version of the source instance.

This parameter is required.', example='4.4'),
  globalSecurityGroupIds?: string(name='GlobalSecurityGroupIds', description='The global IP address whitelist template of the instance. Separate multiple templates with commas (,). The template name must be globally unique.', example='g-qxieqf40xjst1ngp****'),
  hiddenZoneId?: string(name='HiddenZoneId', description='The ID of secondary zone 2 for multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hong Kong Zone B
*   **cn-hongkong-c**: Hong Kong Zone C
*   **cn-hongkong-d**: Hong Kong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> *   This parameter is available and required if you set the value of **EngineVersion** to **4.4** or **5.0**.
> *   The value of this parameter cannot be the same as the value of **ZoneId** or **SecondaryZoneId**.
> *   For more information about the multi-zone deployment policy of a sharded cluster instance, see [Create a multi-zone sharded cluster instance](https://help.aliyun.com/document_detail/117865.html).', example='cn-hangzhou-i'),
  mongos?: [ 
    {
      class?: string(name='Class', description='The instance type of the mongos node. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).

> *   **N** specifies the serial number of the mongos node for which the instance type is specified. For example, **Mongos.2.Class** specifies the instance type of the second mongos node.
> *   Valid values for **N**: **2** to **32**.

This parameter is required.', example='mdb.shard.2x.xlarge.d'),
    }
  ](name='Mongos', description='The mongos nodes of the instance.

This parameter is required.'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Set the value to VPC.

****', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period', description='The subscription period of the instance. Unit: months.

Valid values: **1** to **9**, **12**, **24**, **36**, and **60**.

> When you set the **ChargeType** parameter to **PrePaid**, this parameter is valid and required.', example='1'),
  protocolType?: string(name='ProtocolType', description='The access protocol type of the instance. Valid values:

*   **mongodb**
*   **dynamodb**', example='mongodb'),
  provisionedIops?: long(name='ProvisionedIops', description='The provisioned IOPS of the instance:', example='1960'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  replicaSet?: [ 
    {
      class?: string(name='Class', description='The instance type of the shard component. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).

> 

*   **N** specifies the serial number of the shard component for which the instance type is specified. For example, **ReplicaSet.2.Class** specifies the instance type of the second shard component.

*   Valid values of **N**: **2** to **32**.

This parameter is required.', example='dds.shard.standard'),
      readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard component.

Valid values: **0**, **1, 2, 3, 4, and 5**. Default value: **0**.

>  **N** specifies the serial number of the shard component for which you want to set the number of read-only nodes. **ReplicaSet.2.ReadonlyReplicas** specifies the number of read-only nodes in the second shard component.', example='0'),
      storage?: int32(name='Storage', description='The storage capacity of the shard component. Unit: GB.

> 

*   The values that can be specified for this parameter vary based on the instance types. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).

*   **N** specifies the serial number of the shard component for which the storage capacity is specified. For example, **ReplicaSet.2.Storage** specifies the storage capacity of the second shard component.

This parameter is required.', example='10'),
    }
  ](name='ReplicaSet', description='The information of the shard component.

This parameter is required.'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID. For more information, see [View the basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='The point in time to restore the instance, which must be within seven days. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in Coordinated Universal Time (UTC).

> This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify **SrcDBInstanceId**.', example='2022-03-08T02:30:25Z'),
  restoreType?: string(name='RestoreType', description='The restoration type of the instance. Valid values:

*   1: restores the instance data to the specified point in time.
*   2: restores the data of the released instance to the specified backup set.
*   3: restores the instance data to the specified cross-region backup set.', example='1'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of secondary zone 1 for multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hong Kong Zone B
*   **cn-hongkong-c**: Hong Kong Zone C
*   **cn-hongkong-d**: Hong Kong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> *   This parameter is available and required if you set the value of **EngineVersion** to **4.4** or **5.0**.
> *   The value of this parameter cannot be the same as the value of **ZoneId** or **HiddenZoneId**.
> *   For more information about the multi-zone deployment policy of a sharded cluster instance, see [Create a multi-zone sharded cluster instance](https://help.aliyun.com/document_detail/117865.html).', example='cn-hangzhou-h'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in an IP address whitelist of the instance. Multiple IP addresses are separated by commas (,), and each IP address in the IP address whitelist must be unique. The following types of values are supported:

*   0.0.0.0/0
*   IP addresses, such as 10.23.12.24.
*   CIDR blocks, such as 10.23.12.0/24. In this case, 24 indicates that the prefix of each IP address is 24-bit long. You can replace 24 with a value within the range of 1 to 32.

> *   A maximum of 1,000 IP addresses and CIDR blocks can be configured for each instance.
> *   If you enter 0.0.0.0/0, all IP addresses can access the instance. This may introduce security risks to the instance. Proceed with caution.', example='192.168.xx.xx,192.168.xx.xx'),
  srcDBInstanceId?: string(name='SrcDBInstanceId', description='The source instance ID.

> This parameter is required only if you call this operation to clone an instance. If you specify this parameter, you must also specify **RestoreTime**.', example='dds-bp11483712c1****'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.

> This parameter is required when restore type is set to 2 or 3.', example='cn-beijing'),
  storageEngine?: string(name='StorageEngine', description='The storage engine of the instance. Set the value to **WiredTiger**.

> 

*   If you call this operation to clone an instance, set the value of this parameter to the storage engine of the source instance.

*   For more information about the limits on database versions and storage engines, see [MongoDB versions and storage engines](https://help.aliyun.com/document_detail/61906.html).', example='WiredTiger'),
  storageType?: string(name='StorageType', description='The storage type of the instance. Valid values:

*   **cloud_essd1**: ESSD PL1
*   **cloud_essd2**: ESSD PL2
*   **cloud_essd3**: ESSD PL3
*   **local_ssd**: local SSD

> *   Instances of MongoDB 4.4 and later support only cloud disks. **cloud_essd1** is selected if you leave this parameter empty.
> *   Instances of MongoDB 4.2 and earlier support only local disks. **local_ssd** is selected if you leave this parameter empty.', example='cloud_essd1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

>  **N** specifies the serial number of the tag. For example, **Tag.1.Key** specifies the key of the first tag and **Tag.2.Key** specifies the key of the second tag.', example='testdatabase'),
      value?: string(name='Value', description='The tag value.

>  **N** specifies the serial number of the tag. For example, **Tag.1.Value** specifies the value of the first tag and Tag.2.Value specifies the value of the second tag.', example='apitest'),
    }
  ](name='Tag', description='The custom tags that you want to add to the instance.'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the instance.', example='vsw-bp1vj604nj5a9zz74****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-bp1n3i15v90el48nx****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent zone list.', example='cn-hangzhou-g'),
}

model CreateShardingDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp114f14849d****'),
  orderId?: string(name='OrderId', description='The order ID.', example='21010996721****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D8F1D721-6439-4257-A89C-F1E8E9C9****'),
}

model CreateShardingDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateShardingDBInstanceResponseBody(name='body'),
}

/**
 * @summary Creates or clones an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description *   Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * *   For more information about the instance types of ApsaraDB for MongoDB, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * *   To create standalone instances and replica set instances, you can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation.
 *
 * @param request CreateShardingDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateShardingDBInstanceResponse
 */
async function createShardingDBInstanceWithOptions(request: CreateShardingDBInstanceRequest, runtime: Util.RuntimeOptions): CreateShardingDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.configServer)) {
    query['ConfigServer'] = request.configServer;
  }
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.encrypted)) {
    query['Encrypted'] = request.encrypted;
  }
  if (!Util.isUnset(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.globalSecurityGroupIds)) {
    query['GlobalSecurityGroupIds'] = request.globalSecurityGroupIds;
  }
  if (!Util.isUnset(request.hiddenZoneId)) {
    query['HiddenZoneId'] = request.hiddenZoneId;
  }
  if (!Util.isUnset(request.mongos)) {
    query['Mongos'] = request.mongos;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.protocolType)) {
    query['ProtocolType'] = request.protocolType;
  }
  if (!Util.isUnset(request.provisionedIops)) {
    query['ProvisionedIops'] = request.provisionedIops;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicaSet)) {
    query['ReplicaSet'] = request.replicaSet;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!Util.isUnset(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  if (!Util.isUnset(request.srcDBInstanceId)) {
    query['SrcDBInstanceId'] = request.srcDBInstanceId;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  if (!Util.isUnset(request.storageEngine)) {
    query['StorageEngine'] = request.storageEngine;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateShardingDBInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates or clones an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description *   Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * *   For more information about the instance types of ApsaraDB for MongoDB, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * *   To create standalone instances and replica set instances, you can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation.
 *
 * @param request CreateShardingDBInstanceRequest
 * @return CreateShardingDBInstanceResponse
 */
async function createShardingDBInstance(request: CreateShardingDBInstanceRequest): CreateShardingDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createShardingDBInstanceWithOptions(request, runtime);
}

model DeleteDBInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCzxxxxxxxxxx'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='72651AF9-7897-41A7-8B67-6C15C7F26A0A'),
}

model DeleteDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBInstanceResponseBody(name='body'),
}

/**
 * @summary Releases an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements
 * *   The instance is in the Running state.
 * *   The billing method of the instance is pay-as-you-go.
 * > After an instance is released, all data in the instance is cleared and cannot be recovered. Proceed with caution.
 *
 * @param request DeleteDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstanceWithOptions(request: DeleteDBInstanceRequest, runtime: Util.RuntimeOptions): DeleteDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements
 * *   The instance is in the Running state.
 * *   The billing method of the instance is pay-as-you-go.
 * > After an instance is released, all data in the instance is cleared and cannot be recovered. Proceed with caution.
 *
 * @param request DeleteDBInstanceRequest
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstance(request: DeleteDBInstanceRequest): DeleteDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBInstanceWithOptions(request, runtime);
}

model DeleteGlobalSecurityIPGroupRequest {
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   It can contain lowercase letters, digits, and underscores (_).
*   It must start with a letter and end with a letter or digit.
*   It must be 2 to 120 characters in length.', example='corp'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-qxieqf40xjst1ngpr3jz'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteGlobalSecurityIPGroupResponseBody = {
  requestId?: string(name='RequestId', description='The unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='2F42BB4E-461F-5B55-A37C-53B1141C****'),
}

model DeleteGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a global IP whitelist template.
 *
 * @param request DeleteGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGlobalSecurityIPGroupResponse
 */
async function deleteGlobalSecurityIPGroupWithOptions(request: DeleteGlobalSecurityIPGroupRequest, runtime: Util.RuntimeOptions): DeleteGlobalSecurityIPGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!Util.isUnset(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGlobalSecurityIPGroup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a global IP whitelist template.
 *
 * @param request DeleteGlobalSecurityIPGroupRequest
 * @return DeleteGlobalSecurityIPGroupResponse
 */
async function deleteGlobalSecurityIPGroup(request: DeleteGlobalSecurityIPGroupRequest): DeleteGlobalSecurityIPGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGlobalSecurityIPGroupWithOptions(request, runtime);
}

model DeleteNodeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the generated token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCzxxxxxxxxxx'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the shard or mongos node that you want to delete. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/61923.html) operation to query node IDs.

This parameter is required.', example='s-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteNodeResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='111111111111111'),
  requestId?: string(name='RequestId', description='The request ID.', example='9F9BDE64-BF30-41F3-BD29-C19CE4AB3404'),
  taskId?: int32(name='TaskId', description='The ID of the task.', example='111111111'),
}

model DeleteNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteNodeResponseBody(name='body'),
}

/**
 * @summary Deletes a shard or mongos node from an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   The instance is a sharded cluster instance.
 * *   The billing method of the instance is pay-as-you-go.
 * *   The number of the shard or mongos nodes in the instance is greater than two.
 *
 * @param request DeleteNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteNodeResponse
 */
async function deleteNodeWithOptions(request: DeleteNodeRequest, runtime: Util.RuntimeOptions): DeleteNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteNode',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a shard or mongos node from an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   The instance is a sharded cluster instance.
 * *   The billing method of the instance is pay-as-you-go.
 * *   The number of the shard or mongos nodes in the instance is greater than two.
 *
 * @param request DeleteNodeRequest
 * @return DeleteNodeResponse
 */
async function deleteNode(request: DeleteNodeRequest): DeleteNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteNodeWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  accountName?: string(name='AccountName', description='The name of the account. Set the value to **root**.', example='root'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp1fd530f271****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAccountsResponseBody = {
  accounts?: {
    account?: [ 
    {
      accountDescription?: string(name='AccountDescription', description='The description of the account.', example='Admin'),
      accountName?: string(name='AccountName', description='The name of the account.', example='root'),
      accountStatus?: string(name='AccountStatus', description='The status of the account. Valid values:

*   **Unavailable**
*   **Available**', example='Available'),
      characterType?: string(name='CharacterType', description='The role of the account. Valid values:

*   **db**: shard node
*   **cs**: Configserver node
*   **mongos**: mongos node
*   **logic**: sharded cluster instance
*   **normal**: replica set instance', example='mongos'),
      DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance to which the account belongs.', example='dds-bp1fd530f271****'),
    }
  ](name='Account')
  }(name='Accounts', description='The details of the account.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B562A65B-39AB-4EE8-8635-5A222054FB35'),
}

model DescribeAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountsResponseBody(name='body'),
}

/**
 * @summary Queries the database accounts of an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation can be used to query only the information of the root account.
 *
 * @param request DescribeAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountsResponse
 */
async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: Util.RuntimeOptions): DescribeAccountsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccounts',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the database accounts of an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation can be used to query only the information of the root account.
 *
 * @param request DescribeAccountsRequest
 * @return DescribeAccountsResponse
 */
async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeActiveOperationMaintenanceConfigRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeActiveOperationMaintenanceConfigResponseBody = {
  config?: {
    createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M task was created. The timefollows the *yyyy-mm-dd*t*hh:mm:ss*z format. The time is displayed in UTC.', example='2022-01-20T00:05:54+08:00'),
    cycleTime?: string(name='CycleTime', description='The start time of the O\\\\&M period. The time follows the *hh:mm* z format. The time is displayed in UTC.', example='6'),
    cycleType?: string(name='CycleType', description='The cyclical type of the O\\\\&M task.', example='***'),
    maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. The time follows the *hh:mm*z format. The time is displayed in UTC.', example='04:00:00Z'),
    maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. The time follows the *hh:mm*z format.', example='18:00:00Z'),
    modifiedTime?: string(name='ModifiedTime', description='The time when the O\\\\&M task was modified. The time follows the *yyyy-mm-dd*t*hh:mm:ss*z format. The time is displayed in Coordinated Universal Time (UTC).', example='2021-07-26T05:50:34.000+00:00'),
    status?: int32(name='Status', description='The state of the O\\\\&M task. Valid values: **0**: The O\\\\&M task is in the starting state. **1**: The O\\\\&M task is in the running state. **2**: The O\\\\&M task is in the stopped state.', example='1'),
  }(name='Config', description='The description of the configuration.'),
  hasConfig?: int32(name='HasConfig', description='Indicates whether the O\\\\&M task is configured. Valid values:

*   1: The O\\\\&M task is configured.
*   0: The O\\\\&M task is not configured.', example='0'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='72651AF9-7897-41A7-8B67-6C15C7F26A0A'),
}

model DescribeActiveOperationMaintenanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationMaintenanceConfigResponseBody(name='body'),
}

/**
 * @param request DescribeActiveOperationMaintenanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationMaintenanceConfigResponse
 */
async function describeActiveOperationMaintenanceConfigWithOptions(request: DescribeActiveOperationMaintenanceConfigRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationMaintenanceConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationMaintenanceConfig',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeActiveOperationMaintenanceConfigRequest
 * @return DescribeActiveOperationMaintenanceConfigResponse
 */
async function describeActiveOperationMaintenanceConfig(request: DescribeActiveOperationMaintenanceConfigRequest): DescribeActiveOperationMaintenanceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationMaintenanceConfigWithOptions(request, runtime);
}

model DescribeActiveOperationTaskRequest {
  isHistory?: int32(name='IsHistory', description='Specifies whether to return the historical tasks. 

Default value: 0. Valid values:

- 0: returns the current task.
- 1: returns the historical tasks.', example='0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Specify a value greater than 10. Default value: 30.', example='30'),
  productId?: string(name='ProductId', description='The ID of the product.', example='MongoDB'),
  region?: string(name='Region', description='The region ID of the instance.

>  If you set the Region parameter to **all**, all tasks created within your Alibaba Cloud account are queried. In this case, you must set the **taskType** parameter to **all**.

This parameter is required.', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskType?: string(name='TaskType', description='The type of the task. Valid values:

- rds_apsaradb_ha: master-replica switchover
- rds_apsaradb_transfer: instance migration
- rds_apsaradb_upgrade: minor version update

This parameter is required.', example='rds_apsaradb_ha'),
}

model DescribeActiveOperationTaskResponseBody = {
  items?: [ 
    {
      createdTime?: string(name='CreatedTime', description='The time when the task was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2024-11-06T13:11:08Z'),
      dbType?: string(name='DbType', description='The database type of the instance.', example='mongodb'),
      deadline?: string(name='Deadline', description='The deadline before which the time to preform the task can be modified. The time in UTC is displayed in the yyyy-MM-ddTHH:mm:ssZ format.', example='2023-03-29T13:59:59Z'),
      id?: int32(name='Id', description='The task ID.', example='50xx'),
      insName?: string(name='InsName', description='The instance ID.', example='dds-bp12721xxxx9b914'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the task was modified. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2023-02-24T08:18:53Z'),
      prepareInterval?: string(name='PrepareInterval', description='The required preparation period between the task start time and the switchover time. The time is displayed in the HH:mm:ss format.', example='14:00:00'),
      region?: string(name='Region', description='The region of the instance.', example='cn-beijing'),
      resultInfo?: string(name='ResultInfo', description='The result information.', example='""'),
      startTime?: string(name='StartTime', description='The time when the task was preformed. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2023-03-20T02:40:00Z'),
      status?: int32(name='Status', description='The state of the task. Valid values:

- 2: The task is waiting for users to specify a switchover time.
- 3: The task is waiting to be performed.
- 4: The task is being performed. If the task is in this state, the ModifyActiveOperationTask operation cannot be called to modify the scheduled switchover time.
- 5: The task is performed.
- 6: The task fails.
- 7: The task is canceled.', example='2'),
      switchTime?: string(name='SwitchTime', description='The time when the system performs the switchover operation. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.', example='2024-11-06T14:11:08Z'),
      taskParams?: string(name='TaskParams', description='The task parameters.', example='""'),
      taskType?: string(name='TaskType', description='The type of the task. Valid values:

- rds_apsaradb_ha: master-replica switchover
- rds_apsaradb_transfer: instance migration
- rds_apsaradb_upgrade: minor version update
- all: all types', example='rds_apsaradb_ha'),
    }
  ](name='Items', description='The list of tasks.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='6FD47DC4-0750-5524-A89E-E7D559Cxxxxx'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='0'),
}

model DescribeActiveOperationTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskResponseBody(name='body'),
}

/**
 * @summary Queries the detailed information about  tasks of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskResponse
 */
async function describeActiveOperationTaskWithOptions(request: DescribeActiveOperationTaskRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isHistory)) {
    query['IsHistory'] = request.isHistory;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTask',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the detailed information about  tasks of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTaskRequest
 * @return DescribeActiveOperationTaskResponse
 */
async function describeActiveOperationTask(request: DescribeActiveOperationTaskRequest): DescribeActiveOperationTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTaskWithOptions(request, runtime);
}

model DescribeActiveOperationTaskCountRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='sg-bp5689ac****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeActiveOperationTaskCountResponseBody = {
  needPop?: int32(name='NeedPop', description='Indicates whether any O\\\\&M tasks need pop-up windows to notify users actions. Valid values:

*   **0**: No O\\\\&M tasks need pop-up windows to notify users actions.
*   **1**: Some O\\\\&M tasks need pop-up windows to notify users actions.', example='0'),
  requestId?: string(name='RequestId', description='The request ID.', example='770D7F11-21A2-402B-9DF6-D1A620570EF9'),
  taskCount?: int32(name='TaskCount', description='The number of pending O\\\\&M tasks.', example='0'),
}

model DescribeActiveOperationTaskCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of operation and maintenance tasks on an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTaskCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskCountResponse
 */
async function describeActiveOperationTaskCountWithOptions(request: DescribeActiveOperationTaskCountRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTaskCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTaskCount',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the number of operation and maintenance tasks on an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTaskCountRequest
 * @return DescribeActiveOperationTaskCountResponse
 */
async function describeActiveOperationTaskCount(request: DescribeActiveOperationTaskCountRequest): DescribeActiveOperationTaskCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTaskCountWithOptions(request, runtime);
}

model DescribeActiveOperationTaskRegionRequest {
  isHistory?: int32(name='IsHistory', description='Specifies whether to return the historical tasks. Default value: 0. Valid values:

- 0: returns the current task.
- 1: returns the historical tasks.', example='0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskType?: string(name='TaskType', description='The type of the task. Valid values:

- rds_apsaradb_ha: master-replica switchover
- rds_apsaradb_transfer: instance migration
- rds_apsaradb_upgrade: minor version update
- all: all types

This parameter is required.', example='rds_apsaradb_upgrade'),
}

model DescribeActiveOperationTaskRegionResponseBody = {
  regionList?: [ 
    {
      count?: int32(name='Count', description='The total number of tasks.', example='1'),
      region?: string(name='Region', description='The region ID of the instance.', example='cn-beijing'),
    }
  ](name='RegionList', description='The region ID.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3C4A2494-XXXX-XXXX-93CF-548DB3375193'),
}

model DescribeActiveOperationTaskRegionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskRegionResponseBody(name='body'),
}

/**
 * @param request DescribeActiveOperationTaskRegionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskRegionResponse
 */
async function describeActiveOperationTaskRegionWithOptions(request: DescribeActiveOperationTaskRegionRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTaskRegionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isHistory)) {
    query['IsHistory'] = request.isHistory;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTaskRegion',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DescribeActiveOperationTaskRegionRequest
 * @return DescribeActiveOperationTaskRegionResponse
 */
async function describeActiveOperationTaskRegion(request: DescribeActiveOperationTaskRegionRequest): DescribeActiveOperationTaskRegionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTaskRegionWithOptions(request, runtime);
}

model DescribeActiveOperationTaskTypeRequest {
  isHistory?: int32(name='IsHistory', description='Specifies whether to return historical O\\\\&M tasks. Valid values:

*   **0** (default): The system returns only pending O\\\\&M tasks.
*   **1**: The system returns historical O\\\\&M tasks.', example='0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID. You can call the [DescribeSecurityGroupConfiguration](https://help.aliyun.com/document_detail/146130.html) operation to query the resource group ID.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeActiveOperationTaskTypeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C7EE83BF-7BA8-5087-BAC9-ED85ED54****'),
  typeList?: [ 
    {
      count?: int32(name='Count', description='The number of pending tasks.', example='1'),
      taskType?: string(name='TaskType', description='The type of the task. Valid values:

*   **rds_apsaradb_transfer**: data migration
*   **rds_apsaradb_upgrade**: minor version update', example='rds_apsaradb_upgrade'),
      taskTypeInfoEn?: string(name='TaskTypeInfoEn', description='The task type in English.', example='rds_apsaradb_upgrade'),
      taskTypeInfoZh?: string(name='TaskTypeInfoZh', description='The task type in Chinese.', example='rds_apsaradb_upgrade'),
    }
  ](name='TypeList', description='The O\\\\&M tasks.'),
}

model DescribeActiveOperationTaskTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTaskTypeResponseBody(name='body'),
}

/**
 * @summary Queries the types of Operation and Maintenance tasks and the number of tasks of each type for an ApsaraDB for MongoDB instance.
 *
 * @description This operation is no longer updated and will be unavailable.
 *
 * @param request DescribeActiveOperationTaskTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTaskTypeResponse
 */
async function describeActiveOperationTaskTypeWithOptions(request: DescribeActiveOperationTaskTypeRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTaskTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isHistory)) {
    query['IsHistory'] = request.isHistory;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTaskType',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the types of Operation and Maintenance tasks and the number of tasks of each type for an ApsaraDB for MongoDB instance.
 *
 * @description This operation is no longer updated and will be unavailable.
 *
 * @param request DescribeActiveOperationTaskTypeRequest
 * @return DescribeActiveOperationTaskTypeResponse
 */
async function describeActiveOperationTaskType(request: DescribeActiveOperationTaskTypeRequest): DescribeActiveOperationTaskTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTaskTypeWithOptions(request, runtime);
}

model DescribeActiveOperationTasksRequest {
  allowCancel?: int32(name='AllowCancel', description='Specifies whether to allow the cancellation operation. Valid values:

*   **0**: The cancellation operation is not allowed.
*   **1**: The cancellation operation is allowed.', example='***'),
  allowChange?: int32(name='AllowChange', description='Specifies whether to allow the modification operation. Valid values:

*   **0**: The modification operation is not allowed.
*   **1**: The modification operation is allowed.', example='-1'),
  changeLevel?: string(name='ChangeLevel', description='The type of task configuration change. Valid values:

*   **all** (default): The configurations of all O\\\\&M tasks are changed.
*   **S0**: The configurations of tasks initiated to fix exceptions are changed.
*   **S1**: The configurations of system O\\\\&M tasks are changed.', example='***'),
  dbType?: string(name='DbType', description='The type of the database engine.', example='***'),
  insName?: string(name='InsName', description='The name of the instance.', example='dds-bp16aaccfe10e3e4'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Specify the parameter to a positive integer that is greater than **0**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: **30**.', example='30'),
  productId?: string(name='ProductId', description='The ID of the service.', example='***'),
  region?: string(name='Region', description='The region ID of the instance.

>  If you set the Region parameter to **all**, all tasks created within your Alibaba Cloud account are queried. In this case, you must set the **taskType** parameter to **all**.', example='cn-beijing'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: int32(name='Status', description='The status of the task. Valid values:

*   **0**: waiting for execution
*   **1**: being executed
*   **2**: successful
*   **3**: failed', example='0'),
  taskType?: string(name='TaskType', description='The task type.', example='***'),
}

model DescribeActiveOperationTasksResponseBody = {
  items?: [ 
    {
      allowCancel?: string(name='AllowCancel', description='N/A', example='***'),
      allowChange?: string(name='AllowChange', description='Indicates whether the modification operation is allowed.

*   **0**: The modification operation is not allowed.
*   **1**: The modification operation is allowed.', example='0'),
      changeLevel?: string(name='ChangeLevel', description='The change level of the O\\\\&M task.', example='***'),
      changeLevelEn?: string(name='ChangeLevelEn', description='N/A', example='***'),
      changeLevelZh?: string(name='ChangeLevelZh', description='The task type in English.', example='***'),
      createdTime?: string(name='CreatedTime', description='The time when the task was created.', example='2021-07-14 10:48:43'),
      currentAVZ?: string(name='CurrentAVZ', description='N/A', example='***'),
      dbType?: string(name='DbType', description='The type of the database engine.', example='mongoDb'),
      dbVersion?: string(name='DbVersion', description='The version of the database engine.', example='5.6'),
      deadline?: string(name='Deadline', description='The end time of the O\\\\&M task.', example='1646014421633'),
      id?: int32(name='Id', description='The task ID.', example='***'),
      impactEn?: string(name='ImpactEn', description='N/A', example='***'),
      impactZh?: string(name='ImpactZh', description='N/A', example='***'),
      insComment?: string(name='InsComment', description='The description of the instance.', example='***'),
      insName?: string(name='InsName', description='The ID of the node.', example='***'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the task is modified. The time follows the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2022-12-24T09:48:01Z'),
      prepareInterval?: string(name='PrepareInterval', description='The required preparation period between the task start time and the switchover time. The time is displayed in the *HH:mm:ss* format.', example='***'),
      region?: string(name='Region', description='The region of the instance.', example='cn-hangzhou'),
      resultInfo?: string(name='ResultInfo', description='The result information. The value of this parameter can be ignored.', example='***'),
      startTime?: string(name='StartTime', description='The start time of the task. The time follows the ISO 8601 standard in the *yyyy-mm-dd* T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2022-12-24T06:01:05Z'),
      status?: int32(name='Status', description='N/A', example='***'),
      subInsNames?: [ string ](name='SubInsNames', description='The subinstances.'),
      switchTime?: string(name='SwitchTime', description='The switchover point in time in which disconnection may occur. The time follows the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2022-11-24T11:20:00Z'),
      taskType?: string(name='TaskType', description='The task type.', example='***'),
      taskTypeEn?: string(name='TaskTypeEn', description='N/A', example='***'),
      taskTypeZh?: string(name='TaskTypeZh', description='The task type in Chinese.', example='***'),
    }
  ](name='Items', description='The O\\\\&M tasks.'),
  pageNumber?: int32(name='PageNumber', description='The number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='111E7B16-0A87-4CBA-B271-F34AD61E099F'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='727'),
}

model DescribeActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Queries a list of operation and maintenance tasks initiated for an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasksWithOptions(request: DescribeActiveOperationTasksRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allowCancel)) {
    query['AllowCancel'] = request.allowCancel;
  }
  if (!Util.isUnset(request.allowChange)) {
    query['AllowChange'] = request.allowChange;
  }
  if (!Util.isUnset(request.changeLevel)) {
    query['ChangeLevel'] = request.changeLevel;
  }
  if (!Util.isUnset(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!Util.isUnset(request.insName)) {
    query['InsName'] = request.insName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTasks',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of operation and maintenance tasks initiated for an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasks(request: DescribeActiveOperationTasksRequest): DescribeActiveOperationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTasksWithOptions(request, runtime);
}

model DescribeAuditLogFilterRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp12c5b040dc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleType?: string(name='RoleType', description='The role of the node in the instance. Valid values:

* **mongos**: mongos node.
* **db** : shard node.
* **logic** : logical instance.', example='logic'),
}

model DescribeAuditLogFilterResponseBody = {
  filter?: string(name='Filter', description='The type of the audit log entries. Valid values:

*   **admin**: O\\\\&M and management operations
*   **slow**: slow query logs
*   **query**: query operations
*   **insert**: insert operations
*   **update**: update operations
*   **delete**: delete operations
*   **command**: protocol commands such as the aggregate method', example='admin,slow,insert,query,update,delete,command'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7BAFB0B3-2A54-5B65-B13E-3937CF08FEE6'),
  roleType?: string(name='RoleType', description='The role of the node.', example='logic'),
}

model DescribeAuditLogFilterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditLogFilterResponseBody(name='body'),
}

/**
 * @summary Queries the types of entries in the audit log collected for an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditLogFilterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditLogFilterResponse
 */
async function describeAuditLogFilterWithOptions(request: DescribeAuditLogFilterRequest, runtime: Util.RuntimeOptions): DescribeAuditLogFilterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditLogFilter',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the types of entries in the audit log collected for an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditLogFilterRequest
 * @return DescribeAuditLogFilterResponse
 */
async function describeAuditLogFilter(request: DescribeAuditLogFilterRequest): DescribeAuditLogFilterResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditLogFilterWithOptions(request, runtime);
}

model DescribeAuditPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp12c5b040dc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAuditPolicyResponseBody = {
  logAuditStatus?: string(name='LogAuditStatus', description='Indicates whether the log audit feature is enabled. Valid values:

*   Enable
*   Disabled

Default value: Disabled.', example='Enable'),
  requestId?: string(name='RequestId', description='The request ID.', example='111E7B16-0A87-4CBA-B271-F34AD61E099F'),
}

model DescribeAuditPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditPolicyResponseBody(name='body'),
}

/**
 * @summary Queries whether the audit log feature is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditPolicyResponse
 */
async function describeAuditPolicyWithOptions(request: DescribeAuditPolicyRequest, runtime: Util.RuntimeOptions): DescribeAuditPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditPolicy',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether the audit log feature is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditPolicyRequest
 * @return DescribeAuditPolicyResponse
 */
async function describeAuditPolicy(request: DescribeAuditPolicyRequest): DescribeAuditPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditPolicyWithOptions(request, runtime);
}

model DescribeAuditRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

> If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp12c5b040dc****'),
  database?: string(name='Database', description='The name of the database to be queried. By default, all databases are queried.', example='database****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

> The end time must be within 24 hours from the start time. Otherwise, the query fails.

This parameter is required.', example='2019-03-13T13:11:14Z'),
  form?: string(name='Form', description='The form of the audit log that the operation returns. Valid values:

*   **File**: triggers the generation of audit logs. If this parameter is set to File, only common parameters are returned.
*   **Stream** (default): returns data streams.', example='Stream'),
  logicalOperator?: string(name='LogicalOperator', description='The logical relationship between multiple keywords. Valid values:

*   **or**
*   **and** (default value)', example='and'),
  nodeId?: string(name='NodeId', description='The ID of the mongos node or shard node in the instance.

> This parameter takes effect only when you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='d-bp128a003436****'),
  orderType?: string(name='OrderType', description='The order of time in which the log entries to return are sorted. Valid values:

*   **asc**: The log entries are sorted by time in ascending order.
*   **desc**: The log entries are sorted by time in descending order.', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return. The valid value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return per page. Default value: 30. Valid values: **30**, **50**, and **100**.', example='30'),
  queryKeywords?: string(name='QueryKeywords', description='The keywords used for query. You can enter up to 10 keywords at a time. If you enter multiple keywords, separate the keywords with spaces.', example='slow'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.

This parameter is required.', example='2019-03-13T12:11:14Z'),
  user?: string(name='User', description='The user of the database. If you do not specify this parameter, this operation returns records of all users.', example='test'),
}

model DescribeAuditRecordsResponseBody = {
  items?: {
    SQLRecord?: [ 
    {
      accountName?: string(name='AccountName', description='The account of the database.', example='test'),
      DBName?: string(name='DBName', description='The name of the database.', example='test123'),
      executeTime?: string(name='ExecuteTime', description='The time when the statement was executed. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-11T03:30:27Z'),
      hostAddress?: string(name='HostAddress', description='The IP addresses of the client.', example='11.xxx.xxx.xxx'),
      returnRowCounts?: long(name='ReturnRowCounts', description='The number of SQL audit log entries that are returned.', example='2'),
      syntax?: string(name='Syntax', description='The statement that was executed.', example='{ \\\\"atype\\\\" : \\\\"createCollection\\\\", \\\\"param\\\\" : { \\\\"ns\\\\" : \\\\"123.test1\\\\" }, \\\\"result\\\\": \\\\"OK\\\\" }'),
      tableName?: string(name='TableName', description='The name of the collection.', example='C1'),
      threadID?: string(name='ThreadID', description='The ID of the thread.', example='140682188297984'),
      totalExecutionTimes?: long(name='TotalExecutionTimes', description='The duration of the statement execution. Unit: microseconds.', example='700'),
    }
  ](name='SQLRecord')
  }(name='Items', description='An array that consists of the information of audit log entries.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The maximum number of entries on the current page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='3278BEB8-503B-4E46-8F7E-D26E040C9769'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='40'),
}

model DescribeAuditRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the audit logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   When you call this operation, ensure that the audit log feature of the instance is enabled. Otherwise, the operation returns an empty audit log.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditRecordsResponse
 */
async function describeAuditRecordsWithOptions(request: DescribeAuditRecordsRequest, runtime: Util.RuntimeOptions): DescribeAuditRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.database)) {
    query['Database'] = request.database;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.form)) {
    query['Form'] = request.form;
  }
  if (!Util.isUnset(request.logicalOperator)) {
    query['LogicalOperator'] = request.logicalOperator;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryKeywords)) {
    query['QueryKeywords'] = request.queryKeywords;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.user)) {
    query['User'] = request.user;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditRecords',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the audit logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   When you call this operation, ensure that the audit log feature of the instance is enabled. Otherwise, the operation returns an empty audit log.
 * *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeAuditRecordsRequest
 * @return DescribeAuditRecordsResponse
 */
async function describeAuditRecords(request: DescribeAuditRecordsRequest): DescribeAuditRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditRecordsWithOptions(request, runtime);
}

model DescribeAvailabilityZonesRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the returned **RegionName** and **ZoneName** parameter values. Valid values:

*   **zh** (default): Chinese
*   **en**: English', example='en'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The instance type of the instance.', example='dds.mongo.standard'),
  dbType?: string(name='DbType', description='The architecture of the instance. Valid values:

*   **normal**: replica set instance
*   **sharding**: sharded cluster instance', example='normal'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='5.0'),
  excludeSecondaryZoneId?: string(name='ExcludeSecondaryZoneId', description='The secondary zone ID that is excluded from the query results. You can configure the ExcludeZoneId and ExcludeSecondaryZoneId parameters to specify the IDs of multiple zones that are excluded from the query results.', example='cn-shanghai-b'),
  excludeZoneId?: string(name='ExcludeZoneId', description='The zone ID that is excluded from the query results.', example='cn-shanghai-g'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the product. Valid values:

*   **PrePaid**: subscription
*   **PostPaid:** pay-as-you-go', example='PrePaid'),
  instanceType?: string(name='InstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='replicate'),
  mongoType?: string(name='MongoType', description='The edition of the instance. High-Available Edition and Preview Edition (dbfs) are supported.', example='dbfs'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the latest available regions.

This parameter is required.', example='cn-hangzhou'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

>  This parameter is available only for replica set instances.

Valid values:

*   1
*   3
*   5
*   7', example='3'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmx2m4rqu7pry'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  storageSupport?: string(name='StorageSupport', description='The storage type. Valid values:

*   **cloud**: displays only zones available for instances that use cloud disks.
*   **local**: only displays zones available for instances that use local disks instances.
*   **default** or unspecified: displays zones available for instances that use cloud disks and those that use local disks.', example='local'),
  storageType?: string(name='StorageType', description='The disk type. Valid values:

*   **cloud_essd**: PL1 Enterprise SSD (ESSD)
*   **cloud_essd2**: PL2 ESSD
*   **cloud_essd3**: PL3 ESSD
*   **dhg_local_ssd**: local SSD

> 

*   Instances that run MongoDB 4.4 or later only use cloud disks to store data. If you do not specify this parameter, the value **cloud_essd1** is used by default.

*   Instances that run MongoDB 4.2 and earlier only use local disks to store data. If you do not specify this parameter, the value **local_ssd** is used by default.', example='local_ssd'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query available zones.', example='cn-hangzhou-b'),
}

model DescribeAvailabilityZonesResponseBody = {
  availableZones?: [ 
    {
      regionId?: string(name='RegionId', description='The ID of the region. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the latest available regions.', example='cn-beijing'),
      zoneId?: string(name='ZoneId', description='The ID of the zone.', example='cn-beijing-f'),
      zoneName?: string(name='ZoneName', description='The name of the zone.

The return value of the ZoneName parameter is in the language that is specified by the **AcceptLanguage** parameter. For example, if the value of the ZoneId parameter in the response is **cn-hangzhou-h**, the following values are returned for the ZoneName parameter:

*   If the value of the **AcceptLanguage** parameter is **zh**, **H** is returned for the ZoneName parameter.
*   If the value of the **AcceptLanguage** parameter is **en**, **Hangzhou Zone H** is returned for the ZoneName parameter.', example='Hangzhou Zone H'),
    }
  ](name='AvailableZones', description='The details of the zones in which you can create ApsaraDB for MongoDB instances.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='19A13A33-0FAD-5120-8AE1-B1636F74DD80'),
}

model DescribeAvailabilityZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailabilityZonesResponseBody(name='body'),
}

/**
 * @summary Queries a list of the zones that are supported by an ApsaraDB for MongoDB instance.
 *
 * @description Queries the zones in which an ApsaraDB for MongoDB instance can be deployed under specified purchase conditions. The region ID is required in the purchase condition.
 *
 * @param request DescribeAvailabilityZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailabilityZonesResponse
 */
async function describeAvailabilityZonesWithOptions(request: DescribeAvailabilityZonesRequest, runtime: Util.RuntimeOptions): DescribeAvailabilityZonesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.excludeSecondaryZoneId)) {
    query['ExcludeSecondaryZoneId'] = request.excludeSecondaryZoneId;
  }
  if (!Util.isUnset(request.excludeZoneId)) {
    query['ExcludeZoneId'] = request.excludeZoneId;
  }
  if (!Util.isUnset(request.instanceChargeType)) {
    query['InstanceChargeType'] = request.instanceChargeType;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.mongoType)) {
    query['MongoType'] = request.mongoType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.storageSupport)) {
    query['StorageSupport'] = request.storageSupport;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailabilityZones',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of the zones that are supported by an ApsaraDB for MongoDB instance.
 *
 * @description Queries the zones in which an ApsaraDB for MongoDB instance can be deployed under specified purchase conditions. The region ID is required in the purchase condition.
 *
 * @param request DescribeAvailabilityZonesRequest
 * @return DescribeAvailabilityZonesResponse
 */
async function describeAvailabilityZones(request: DescribeAvailabilityZonesRequest): DescribeAvailabilityZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailabilityZonesWithOptions(request, runtime);
}

model DescribeAvailableEngineVersionRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAvailableEngineVersionResponseBody = {
  engineVersions?: {
    engineVersion?: [ string ](name='EngineVersion')
  }(name='EngineVersions', description='The list of one or more engine versions to which an ApsaraDB for MongoDB instance can be upgraded.

>  An empty string is returned if the latest version is being used.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='52507B6B-003B-47A3-A0A3-9FE992C7A243'),
}

model DescribeAvailableEngineVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableEngineVersionResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the engine versions to which an ApsaraDB for MongoDB instance can be upgraded.
 *
 * @param request DescribeAvailableEngineVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableEngineVersionResponse
 */
async function describeAvailableEngineVersionWithOptions(request: DescribeAvailableEngineVersionRequest, runtime: Util.RuntimeOptions): DescribeAvailableEngineVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableEngineVersion',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the engine versions to which an ApsaraDB for MongoDB instance can be upgraded.
 *
 * @param request DescribeAvailableEngineVersionRequest
 * @return DescribeAvailableEngineVersionResponse
 */
async function describeAvailableEngineVersion(request: DescribeAvailableEngineVersionRequest): DescribeAvailableEngineVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableEngineVersionWithOptions(request, runtime);
}

model DescribeAvailableResourceRequest {
  DBInstanceClass?: string(name='DBInstanceClass', description='The instance type of the instance.', example='dds.mongo.standard'),
  dbType?: string(name='DbType', description='The architecture of the instance. Valid values:

*   **normal**: replica set instance
*   **sharding**: sharded cluster instance', example='sharding'),
  engineVersion?: string(name='EngineVersion', description='The major engine version of the instance.', example='5.0'),
  instanceChargeType?: string(name='InstanceChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid** (default): subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The ID of the region. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the latest available regions.

This parameter is required.', example='cn-hangzhou'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of nodes, only applicable to replica sets.', example='3'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  storageType?: string(name='StorageType', description='The storage type of the instance. Valid values:

*   local_ssd: local SSD
*   cloud_essd1: PL1 enhanced SSD (ESSD)
*   cloud_essd2: PL2 ESSD
*   cloud_essd3: PL3 ESSD
*   cloud_auto: ESSD AutoPL disk

This parameter is empty by default, which indicates all types of storage resources are queried.', example='local_ssd', nullable=true),
  zoneId?: string(name='ZoneId', description='The ID of the zone. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the available zones.', example='cn-hangzhou-h'),
}

model DescribeAvailableResourceResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='344EE51D-8850-4935-B68B-58A8F4DCE3BD'),
  supportedDBTypes?: {
    supportedDBType?: [ 
    {
      availableZones?: {
        availableZone?: [ 
        {
          regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
          supportedEngineVersions?: {
            supportedEngineVersion?: [ 
            {
              supportedEngines?: {
                supportedEngine?: [ 
                {
                  engine?: string(name='Engine', description='The storage engine of the instance.', example='WiredTiger'),
                  supportedNodeTypes?: {
                    supportedNodeType?: [ 
                    {
                      availableResources?: {
                        availableResource?: [ 
                        {
                          DBInstanceStorageRange?: {
                            max?: int32(name='Max', description='The maximum storage capacity. Unit: GB.', example='16000'),
                            min?: int32(name='Min', description='The minimum storage capacity. Unit: GB.', example='20'),
                            step?: int32(name='Step', description='The step size for adjusting the storage capacity. Unit: GB.', example='10'),
                          }(name='DBInstanceStorageRange', description='The storage capacity range of the instance.'),
                          instanceClass?: string(name='InstanceClass', description='The instance family.', example='mdb.shard.2x.xlarge.d'),
                          instanceClassRemark?: string(name='InstanceClassRemark', description='The type of the instance.', example='4 cores, 8 GB (Dedicated) (Current instance type: mdb.shard.2x.xlarge.d (4 cores, 8 GB (Dedicated cloud-disk), maximum connections: 3000, maximum IOPS: min{1800 + 50 × Storage capacity, 21000}))'),
                        }
                      ](name='AvailableResource')
                      }(name='AvailableResources', description='The details of the available resources.'),
                      networkTypes?: string(name='NetworkTypes', description='The network type of the instance.', example='VPC'),
                      nodeType?: string(name='NodeType', description='The number of nodes in the instance.', example='3'),
                    }
                  ](name='SupportedNodeType')
                  }(name='SupportedNodeTypes', description='The supported instance types.'),
                }
              ](name='SupportedEngine')
              }(name='SupportedEngines', description='The supported storage engines.'),
              version?: string(name='Version', description='The database engine version of the instance.', example='4.0'),
            }
          ](name='SupportedEngineVersion')
          }(name='SupportedEngineVersions', description='The supported storage engine versions.'),
          zoneId?: string(name='ZoneId', description='The ID of the zone.', example='cn-hangzhou-h'),
        }
      ](name='AvailableZone')
      }(name='AvailableZones', description='The available zones.'),
      dbType?: string(name='DbType', description='The architecture of the instance. Valid values:

*   **normal**: replica set instance
*   **sharding**: sharded cluster instance', example='sharding'),
    }
  ](name='SupportedDBType')
  }(name='SupportedDBTypes', description='The supported database types.'),
}

model DescribeAvailableResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableResourceResponseBody(name='body'),
}

/**
 * @summary Queries the available resources in the specified zone.
 *
 * @param request DescribeAvailableResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResourceWithOptions(request: DescribeAvailableResourceRequest, runtime: Util.RuntimeOptions): DescribeAvailableResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.instanceChargeType)) {
    query['InstanceChargeType'] = request.instanceChargeType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableResource',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the available resources in the specified zone.
 *
 * @param request DescribeAvailableResourceRequest
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResource(request: DescribeAvailableResourceRequest): DescribeAvailableResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableResourceWithOptions(request, runtime);
}

model DescribeBackupDBsRequest {
  backupId?: string(name='BackupId', description='The backup ID.

> 

*   You can call the [DescribeBackups](https://help.aliyun.com/document_detail/62172.html) operation to query the backup ID.

*   You must specify one of the **RestoreTime** and BackupId parameters.', example='5664****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return per page. Default value: 30. Valid values: **30**, **50**, and **100**.', example='30'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-ax68****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='The point in time to which the instance is restored. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

> 

*   The time can be a point in time within the previous seven days. The time must be earlier than the current time, but later than the time when the instance was created.

*   You must specify one of the RestoreTime and **BackupId** parameters.', example='2019-08-22T12:00:00Z'),
  sourceDBInstance?: string(name='SourceDBInstance', description='The ID of the source instance.', example='dds-bp2286****'),
}

model DescribeBackupDBsResponseBody = {
  databases?: {
    database?: [ 
    {
      DBName?: string(name='DBName', description='The name of the database.', example='mongodbtest'),
    }
  ](name='Database')
  }(name='Databases', description='The details of the databases.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page returned.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AF0AD89-ED4F-44AD-B65F-BFC1D5CD9455'),
  totalCount?: int32(name='TotalCount', description='The number of returned databases.', example='5'),
}

model DescribeBackupDBsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupDBsResponseBody(name='body'),
}

/**
 * @summary Queries the databases at a specified time or the databases in a specified backup set before you restore a database for an ApsaraDB for MongoDB instance.
 *
 * @description You can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation to restore a database for an ApsaraDB for MongoDB instance. For more information, see [Restore one database of an ApsaraDB for MongoDB instance](https://help.aliyun.com/document_detail/112274.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance was created after March 26, 2019.
 * *   The instance is located in the China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), or Singapore region. Other regions are not supported.
 * *   The instance is a replica set instance.
 * *   The instance runs MongoDB 3.4, MongoDB 4.0, or MongoDB 4.2. In addition, the instance uses local disks to store data.
 * *   The storage engine of the instance is WiredTiger.
 *
 * @param request DescribeBackupDBsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupDBsResponse
 */
async function describeBackupDBsWithOptions(request: DescribeBackupDBsRequest, runtime: Util.RuntimeOptions): DescribeBackupDBsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.sourceDBInstance)) {
    query['SourceDBInstance'] = request.sourceDBInstance;
  }
  if (!Util.isUnset(request.sourceDBInstance)) {
    query['SourceDBInstance'] = request.sourceDBInstance;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupDBs',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the databases at a specified time or the databases in a specified backup set before you restore a database for an ApsaraDB for MongoDB instance.
 *
 * @description You can call the [CreateDBInstance](https://help.aliyun.com/document_detail/61763.html) operation to restore a database for an ApsaraDB for MongoDB instance. For more information, see [Restore one database of an ApsaraDB for MongoDB instance](https://help.aliyun.com/document_detail/112274.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance was created after March 26, 2019.
 * *   The instance is located in the China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), or Singapore region. Other regions are not supported.
 * *   The instance is a replica set instance.
 * *   The instance runs MongoDB 3.4, MongoDB 4.0, or MongoDB 4.2. In addition, the instance uses local disks to store data.
 * *   The storage engine of the instance is WiredTiger.
 *
 * @param request DescribeBackupDBsRequest
 * @return DescribeBackupDBsResponse
 */
async function describeBackupDBs(request: DescribeBackupDBsRequest): DescribeBackupDBsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupDBsWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp16cb162771****'),
  instanceType?: string(name='InstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='sharding'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.', example='cn-beijing'),
}

model DescribeBackupPolicyResponseBody = {
  backupInterval?: int32(name='BackupInterval', description='The frequency at which high-frequency backup is created. Valid values:

*   **-1**: High-frequency backup is disabled.
*   **15**: every 15 minutes.
*   **30**: every 30 minutes.
*   **60**: every hour.
*   **120**: every 2 hours.
*   **180**: every 3 hours.
*   **240**: every 4 hours.
*   **360**: every 6 hours.
*   **480**: every 8 hours.
*   **720**: every 12 hours.', example='-1'),
  backupRetentionPeriod?: string(name='BackupRetentionPeriod', description='The retention period of the backup data. Unit: day.', example='30'),
  backupRetentionPolicyOnClusterDeletion?: int32(name='BackupRetentionPolicyOnClusterDeletion', description='The backup retention policy configured for the instance. Valid values:

1.  0: All backup sets are immediately deleted when the instance is released.
2.  1: Automatic backup is performed and the backup set is retained for a long period of time when the instance is released.
3.  2: Automatic backup is performed and all backup sets are retained for a long period of time when the instance is released.

For more information, see [Retain the backup files of an ApsaraDB for MongoDB instance for a long period of time](https://help.aliyun.com/document_detail/2779111.html).', example='0'),
  crossBackupPeriod?: string(name='CrossBackupPeriod', description='The retention period of Cross-regional backup.
Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**', example='Monday'),
  crossLogRetentionType?: string(name='CrossLogRetentionType', description='The retention type of Cross-regional  log backup.

- delay : retain the backup for a period of time.
- never : retain the backup permanently.', example='delay'),
  crossLogRetentionValue?: int32(name='CrossLogRetentionValue', description='The retention time of Cross-regional log backup.', example='7'),
  crossRetentionType?: string(name='CrossRetentionType', description='The retention type of Cross-regional backup.

- delay : retain the backup for a period of time.
- never : retain the backup permanently.', example='delay'),
  crossRetentionValue?: int32(name='CrossRetentionValue', description='The retention time of Cross-regional backup.', example='7'),
  destRegion?: string(name='DestRegion', description='The region ID of the cross-regional backup..', example='cn-shenzhen'),
  enableBackupLog?: int32(name='EnableBackupLog', description='Indicates whether the log backup feature is enabled. Valid values:

*   **0** (default): The log backup feature is disabled.
*   **1**: The log backup feature is enabled.', example='1'),
  enableCrossLogBackup?: int32(name='EnableCrossLogBackup', description='Whether to turn on cross-regional log backup.
- 1: turn on . Used for sharded cluster.
- 0: turn off. Used for replicate set.', example='1'),
  highFrequencyBackupRetention?: string(name='HighFrequencyBackupRetention', description='The retention period of high-frequency backups. Unit: day.', example='1'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod', description='The number of days for which log backups are retained. Valid values: 7 to 730.', example='7'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The day of a week on which to back up data. Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**', example='Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The time range during which the backup was created. The time follows the ISO 8601 standard in the *HH:mm*Z-*HH:mm*Z format. The time is displayed in UTC.', example='09:00Z-10:00Z'),
  preferredNextBackupTime?: string(name='PreferredNextBackupTime', description='The time of next standard backup.', example='2024-06-19T19:11Z'),
  requestId?: string(name='RequestId', description='The request ID.', example='5A9464CA-F7DC-5434-90B1-DF7F197C****'),
  snapshotBackupType?: string(name='SnapshotBackupType', description='The snapshot backup type. Valid values:

*   **Flash**: single-digit second backup
*   **Standard** (default): standard backup', example='Standard'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.', example='cn-hangzhou'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the backup policy of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: Util.RuntimeOptions): DescribeBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupPolicy',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup policy of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupStorageRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-2zeb2d64cb46xxxx'),
  nodeId?: string(name='NodeId', description='The ID of the shard node in the sharded cluster instance.

>  This parameter is required only when the **DBInstanceId** parameter is set to the ID of a sharded cluster instance.', example='d-2zee48956b4axxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the most recent region list.', example='cn-bejing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeBackupStorageResponseBody = {
  freeSize?: long(name='FreeSize', description='The free quota for the storage capacity used for backup. Unit: bytes.', example='42949672960'),
  fullStorageSize?: long(name='FullStorageSize', description='The storage capacity used for the full backup. Unit: bytes.

>  Instances that use cloud disks support snapshot backup. The size of the storage used for the current full backup is the size of the snapshot chain.', example='789221621'),
  logStorageSize?: long(name='LogStorageSize', description='The storage capacity used for the log backup. Unit: bytes.', example='7892216'),
  requestId?: string(name='RequestId', description='The request ID.', example='D648B367-15B6-1B42-BD4B-4XXXXXXXXX'),
}

model DescribeBackupStorageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupStorageResponseBody(name='body'),
}

/**
 * @summary Queries the storage used for backup in an ApsaraDB for MongoDB replica set or sharded cluster instance that uses cloud disks. Note that you are charged only for the backup-used storage of each shard in a sharded cluster instance. You can call this operation only to query the storage used by a single shard in the instance for backup.
 *
 * @param request DescribeBackupStorageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupStorageResponse
 */
async function describeBackupStorageWithOptions(request: DescribeBackupStorageRequest, runtime: Util.RuntimeOptions): DescribeBackupStorageResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupStorage',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the storage used for backup in an ApsaraDB for MongoDB replica set or sharded cluster instance that uses cloud disks. Note that you are charged only for the backup-used storage of each shard in a sharded cluster instance. You can call this operation only to query the storage used by a single shard in the instance for backup.
 *
 * @param request DescribeBackupStorageRequest
 * @return DescribeBackupStorageResponse
 */
async function describeBackupStorage(request: DescribeBackupStorageRequest): DescribeBackupStorageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupStorageWithOptions(request, runtime);
}

model DescribeBackupTasksRequest {
  backupJobId?: string(name='BackupJobId', description='The ID of the backup task.

>  If you call the [CreateBackup](https://help.aliyun.com/document_detail/468439.html) operation to perform a manual backup task, you can set this parameter to the returned backup ID to query the backup progress of the task.', example='170034'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-2zeb2d64cb46xxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeBackupTasksResponseBody = {
  backupJobs?: [ 
    {
      backupSetStatus?: string(name='BackupSetStatus', description='The backup task status. Valid values:

*   **Scheduled**: The backup task is in planning. Regular backup tasks that have not started are also in this state.
*   **Checking**: The instance is being checked before the backup.
*   **Backuping**: The backup task is in progress.
*   **Finished**: The backup task is completed.', example='Scheduled'),
      backupStartTime?: string(name='BackupStartTime', description='The start time of the backup task.', example='2024-01-16T11:04:56Z'),
      backupjobId?: string(name='BackupjobId', description='The ID of the backup task.', example='170034'),
      jobMode?: string(name='JobMode', description='The backup mode. Valid values:

*   **Automated**: automatic backup
*   **Manual**: manual backup', example='Manual'),
      progress?: string(name='Progress', description='The progress of the backup task. Unit: %. The progress is returned only for running backup tasks.', example='18%'),
    }
  ](name='BackupJobs', description='The details of the backup task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D648B367-15B6-1B42-BD4B-47507C9CC****'),
}

model DescribeBackupTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupTasksResponseBody(name='body'),
}

/**
 * @summary Queries backup tasks running in an ApsaraDB for MongoDB replica set or sharded cluster instance that uses cloud disks.
 *
 * @param request DescribeBackupTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupTasksResponse
 */
async function describeBackupTasksWithOptions(request: DescribeBackupTasksRequest, runtime: Util.RuntimeOptions): DescribeBackupTasksResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupTasks',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries backup tasks running in an ApsaraDB for MongoDB replica set or sharded cluster instance that uses cloud disks.
 *
 * @param request DescribeBackupTasksRequest
 * @return DescribeBackupTasksResponse
 */
async function describeBackupTasks(request: DescribeBackupTasksRequest): DescribeBackupTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupTasksWithOptions(request, runtime);
}

model DescribeBackupsRequest {
  backupId?: string(name='BackupId', description='The ID of the backup set. You can call the [CreateBackup](https://help.aliyun.com/document_detail/62171.html) operation to query the backup set ID.

If you set the **DBInstanceId** parameter to the ID of a sharded cluster instance, the number of backup IDs is the same as the number of shard nodes. Multiple backup IDs are separated with commas (,).', example='2072****,2072****,2072****'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

> If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp1a7009eb24****'),
  destRegion?: string(name='DestRegion', description='The region ID of the Cross-regional backup.

>  This parameter is required for the Cross-regional backup.', example='cn-hangzhou'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC. The end time must be later than the start time.', example='2022-01-14T13:00Z'),
  nodeId?: string(name='NodeId', description='The ID of the shard node in the sharded cluster instance.

> This parameter takes effect only when you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='d-bp128a003436****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.

>- This parameter is required if you want to query the backup sets of a released instance.
>-  This parameter is required if you want to query cross-region backups.', example='cn-beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.', example='2022-01-13T13:00Z'),
}

model DescribeBackupsResponseBody = {
  backups?: {
    backup?: [ 
    {
      backupDBNames?: string(name='BackupDBNames', description='The name of the database that has been backed up.', example='database'),
      backupDownloadURL?: string(name='BackupDownloadURL', description='The URL that is used to download the backup set over the Internet. If the backup set cannot be downloaded, an empty string is returned.'),
      backupEndTime?: string(name='BackupEndTime', description='The end time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-01-14T03:57:34Z'),
      backupId?: string(name='BackupId', description='The ID of the backup set.', example='32102****'),
      backupIntranetDownloadURL?: string(name='BackupIntranetDownloadURL', description='The internal download URL of the backup set.

>  You can use the URL to download the specified backup set on an Elastic Compute Service (ECS) instance that is in the same virtual private cloud (VPC) as the ApsaraDB for MongoDB instance.'),
      backupJobId?: string(name='BackupJobId', description='The ID of the backup task.', example='1123xxxx'),
      backupMethod?: string(name='BackupMethod', description='The method that is used to generate the backup set. Valid values:

*   **Snapshot**
*   **Physical**
*   **Logical**', example='Physical'),
      backupMode?: string(name='BackupMode', description='The backup mode of the backup set. Valid values:

*   **Automated**
*   **Manual**', example='Automated'),
      backupName?: string(name='BackupName', description='The name of the backup set. The parameter is invalid.', example='12345678.tar.gz'),
      backupScale?: string(name='BackupScale', description='The backup granularity. The parameter is invalid.', example='DBInstance'),
      backupSize?: long(name='BackupSize', description='The size of the backup set. Unit: bytes.', example='6168576'),
      backupStartTime?: string(name='BackupStartTime', description='The start time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-01-14T03:56:17Z'),
      backupStatus?: string(name='BackupStatus', description='The status of the backup task. Valid values:

*   **Success**: The backup task is successful.
*   **Failed**: The backup task failed.', example='Success'),
      backupType?: string(name='BackupType', description='The backup type. Valid values:

*   **FullBackup**
*   **IncrementalBackup**', example='FullBackup'),
      engineVersion?: string(name='EngineVersion', description='Version of the backuped instance.

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.2'),
      isAvail?: boolean(name='IsAvail', description='Availability of the backup set.
- 0: unavailable
- 1: available', example='1'),
    }
  ](name='Backup')
  }(name='Backups', description='The details of the backup set.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='275D43C3-F12F-5224-B375-0C6BF453BD56'),
  totalCount?: int32(name='TotalCount', description='The total number of backup sets.', example='1'),
}

model DescribeBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupsResponseBody(name='body'),
}

/**
 * @summary Queries the backup sets of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupsResponse
 */
async function describeBackupsWithOptions(request: DescribeBackupsRequest, runtime: Util.RuntimeOptions): DescribeBackupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackups',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup sets of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeBackupsRequest
 * @return DescribeBackupsResponse
 */
async function describeBackups(request: DescribeBackupsRequest): DescribeBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupsWithOptions(request, runtime);
}

model DescribeClusterBackupsRequest {
  backupId?: string(name='BackupId', description='The ID of the cluster backup set.', example='5664****'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp16cb162771****'),
  destRegion?: string(name='DestRegion', description='The region where cross-region backups reside.

>  This parameter is required if you want to query cross-region backups.', example='cn-shanghai'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.', example='2019-03-14T13:10Z'),
  isOnlyGetClusterBackUp?: boolean(name='IsOnlyGetClusterBackUp', description='Specifies whether to query information about child nodes in the cluster backup. Valid values:

*   **true**: The system returns only the basic information of the cluster backup.
*   **false** (default): The system returns the backup information of all child nodes.', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='The page number. Default value: **1**. The page number must be a positive integer.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.

> 

*   This parameter is required if you want to query the backup sets of a released instance.

*   This parameter is required if you want to query cross-region backups.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.', example='2019-03-13T12:11:14Z'),
}

model DescribeClusterBackupsResponseBody = {
  clusterBackups?: [ 
    {
      attachLogStatus?: string(name='AttachLogStatus', description='The backup status. Valid values:

*   **init**: The backup is being initialized.
*   **No_Need**: Log backup is not performed.
*   **Running**: Log backup is being performed.
*   **Ready**: Log backup is complete.
*   **Failed**: Log backup failed.

>  If the **ClusterBackupStatus** parameter is set to OK, full backup is successful. If you want to perform point-in-time-restoration on an instance for which log backup is enabled or to implement consistency restoration, make sure that log backup is complete.', example='Ready'),
      backups?: [ 
        {
          backupDownloadURL?: string(name='BackupDownloadURL', description='The URL that is used to download the backup set over the Internet. If the backup set cannot be downloaded, an empty string is returned.', example='http://oss.com/xxx'),
          backupEndTime?: string(name='BackupEndTime', description='The end time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2023-10-16T19:33:20Z'),
          backupId?: string(name='BackupId', description='The ID of the backup set.', example='738025367'),
          backupIntranetDownloadURL?: string(name='BackupIntranetDownloadURL', description='The URL that is used to download the backup set over an internal network. If the backup set cannot be downloaded, null is returned.', example='http://oss.com/xxx'),
          backupName?: string(name='BackupName', description='The backup name.', example='12345678.tar.gz'),
          backupSize?: string(name='BackupSize', description='The size of the backup file. Unit: bytes.', example='77544597650'),
          backupStartTime?: string(name='BackupStartTime', description='The start time of the backup. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2023-10-16T19:33:20Z'),
          backupStatus?: string(name='BackupStatus', description='The status of the backup task. Valid values:

*   **Success**: The backup task is successful.
*   **Failed**: The backup task failed.', example='Success'),
          extraInfo?: {
            instanceClass?: string(name='InstanceClass', description='The instance type of the node.', example='mdb.shard.4x.large.d'),
            nodeId?: string(name='NodeId', description='The node ID.', example='d-2ze75ab1fa5d****'),
            nodeType?: string(name='NodeType', description='The node type.', example='db'),
            storageSize?: string(name='StorageSize', description='The storage capacity of the node. Unit: MB.', example='20480'),
          }(name='ExtraInfo', description='The information of the node associated with the backup.'),
          instanceName?: string(name='InstanceName', description='The shard name.', example='d-bp16cb162771****'),
          isAvail?: string(name='IsAvail', description='Indicates whether the backup set is available. Valid values:

*   **0**: unavailable
*   **1**: available', example='1'),
        }
      ](name='Backups', description='The collection of the backup sets of each child node in a cluster backup set.'),
      clusterBackupEndTime?: string(name='ClusterBackupEndTime', description='The end of the time range within which the cluster backup is performed.', example='2023-10-16T19:33:20Z'),
      clusterBackupId?: string(name='ClusterBackupId', description='The backup set ID.', example='cb-o8c2ugnxo26kx***'),
      clusterBackupMode?: string(name='ClusterBackupMode', description='The cluster backup mode.', example='Automated'),
      clusterBackupSize?: string(name='ClusterBackupSize', description='The size of the cluster backup set. Unit: bytes.', example='107374182400'),
      clusterBackupStartTime?: string(name='ClusterBackupStartTime', description='The beginning of the time range within which the cluster backup is performed.', example='2023-10-16T19:33:20Z'),
      clusterBackupStatus?: string(name='ClusterBackupStatus', description='The status of the cluster backup set.', example='OK'),
      engineVersion?: string(name='EngineVersion', description='Version of the backuped instance.

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.2'),
      extraInfo?: {
        registryFromHistory?: string(name='RegistryFromHistory', description='Indicates whether the cluster backups are migrated from the historical backup sets. If the value of this parameter is **1**, the cluster backups are migrated from the historical backup sets.', example='1'),
      }(name='ExtraInfo', description='The additional information in the JSON format.'),
      isAvail?: int32(name='IsAvail', description='Indicates whether the cluster backup sets take effect. Valid values:

*   **1**: The cluster backup sets take effect.
*   **0**: The backup sets of child nodes are incomplete or fail.', example='1'),
      progress?: string(name='Progress', description='The progress of the backup task. Unit: %. The progress is returned only for running backup tasks.', example='50'),
    }
  ](name='ClusterBackups', description='The cluster backup sets. A cluster backup file contains the backup sets of each node.'),
  maxResults?: int32(name='MaxResults', description='The maximum number of entries returned.', example='10'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page returned.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F42BB4E-461F-5B55-A37C-53B1141C****'),
}

model DescribeClusterBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterBackupsResponseBody(name='body'),
}

/**
 * @summary Queries the backup sets of an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description For a sharded cluster instance that is created before October 19, 2023 and uses cloud disks, you must call the [TransferClusterBackup](https://help.aliyun.com/document_detail/2587931.html) operation to switch the instance from the shard backup mode to the cluster backup mode before you call the DescribeClusterBackups operation.
 * By default, cloud disk-based sharded cluster instances that are created after October 19, 2023 are in the cluster backup mode.
 *
 * @param request DescribeClusterBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterBackupsResponse
 */
async function describeClusterBackupsWithOptions(request: DescribeClusterBackupsRequest, runtime: Util.RuntimeOptions): DescribeClusterBackupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.isOnlyGetClusterBackUp)) {
    query['IsOnlyGetClusterBackUp'] = request.isOnlyGetClusterBackUp;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterBackups',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the backup sets of an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description For a sharded cluster instance that is created before October 19, 2023 and uses cloud disks, you must call the [TransferClusterBackup](https://help.aliyun.com/document_detail/2587931.html) operation to switch the instance from the shard backup mode to the cluster backup mode before you call the DescribeClusterBackups operation.
 * By default, cloud disk-based sharded cluster instances that are created after October 19, 2023 are in the cluster backup mode.
 *
 * @param request DescribeClusterBackupsRequest
 * @return DescribeClusterBackupsResponse
 */
async function describeClusterBackups(request: DescribeClusterBackupsRequest): DescribeClusterBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterBackupsWithOptions(request, runtime);
}

model DescribeClusterRecoverTimeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp18f7d6b6a7****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeClusterRecoverTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='60EEBD77-227C-5B39-86EA-D89163C5****'),
  restoreRanges?: [ 
    {
      restoreBeginTime?: string(name='RestoreBeginTime', description='The beginning of the time range to which data can be restored.', example='2023-10-16T19:33:20Z'),
      restoreEndTime?: string(name='RestoreEndTime', description='The end of the time range to which data can be restored.', example='2023-10-16T19:43:20Z'),
      restoreType?: string(name='RestoreType', description='The method used to restore data. Valid values:

*   **PointInTime** (default): Data is restored based on point in time', example='PointInTime'),
    }
  ](name='RestoreRanges', description='The cluster backup sets of the instance. A cluster backup file contains the backup sets of each node.'),
}

model DescribeClusterRecoverTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeClusterRecoverTimeResponseBody(name='body'),
}

/**
 * @summary Queries the time range to which you can restore the data of an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description *   The instance is an ApsaraDB for MongoDB sharded cluster instance that runs MongoDB 4.4 or later and uses enhanced SSDs (ESSDs) to store data.
 * *   You can call the TransferClusterBackup operation only for instances that are created before October 19, 2023 to switch the instances to the cluster backup mode. The DescribeClusterRecoverTime operation is applicable only to instances that are switched to the cluster backup mode or instances that are created on or after October 19, 2023.
 *
 * @param request DescribeClusterRecoverTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeClusterRecoverTimeResponse
 */
async function describeClusterRecoverTimeWithOptions(request: DescribeClusterRecoverTimeRequest, runtime: Util.RuntimeOptions): DescribeClusterRecoverTimeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClusterRecoverTime',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the time range to which you can restore the data of an ApsaraDB for MongoDB sharded cluster instance that uses cloud disks.
 *
 * @description *   The instance is an ApsaraDB for MongoDB sharded cluster instance that runs MongoDB 4.4 or later and uses enhanced SSDs (ESSDs) to store data.
 * *   You can call the TransferClusterBackup operation only for instances that are created before October 19, 2023 to switch the instances to the cluster backup mode. The DescribeClusterRecoverTime operation is applicable only to instances that are switched to the cluster backup mode or instances that are created on or after October 19, 2023.
 *
 * @param request DescribeClusterRecoverTimeRequest
 * @return DescribeClusterRecoverTimeResponse
 */
async function describeClusterRecoverTime(request: DescribeClusterRecoverTimeRequest): DescribeClusterRecoverTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterRecoverTimeWithOptions(request, runtime);
}

model DescribeDBInstanceAttributeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp11483712c1****'),
  engine?: string(name='Engine', description='The database engine. Set the value to **MongoDB**.', example='MongoDB'),
  isDelete?: boolean(name='IsDelete', description='Specifies whether to query instances that are deleted. Valid values:

*   **false**: queries instances that are running.
*   **true**: queries instance that are deleted.', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. For more information, see [View the basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).

> This parameter is available only if you use the China site (aliyun.com).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeDBInstanceAttributeResponseBody = {
  DBInstances?: {
    DBInstance?: [ 
    {
      burstingEnabled?: boolean(name='BurstingEnabled', description='Indicates whether performance burst is enabled for the ESSD AutoPL disk.', example='true'),
      capacityUnit?: string(name='CapacityUnit', description='The read and write throughput consumed by the instance.', example='100'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
      configserverList?: {
        configserverAttribute?: [ 
        {
          connectString?: string(name='ConnectString', description='The endpoint of the Configserver node.', example='dds-bp18b0934e7053e4-cs****.mongodb.rds.aliyuncs.com'),
          currentKernelVersion?: string(name='CurrentKernelVersion', description='The minor version of the current MongoDB kernel.', example='mongodb_20230613_4.0.25'),
          lockMode?: string(name='LockMode', description='The lock status of the Configserver node. Valid values:

*   **Unlock**: The instance is not locked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before a rollback.
*   **LockByDiskQuota**: The instance is automatically locked because its storage capacity is exhausted and the instance is inaccessible.', example='Unlock'),
          maxConnections?: int32(name='MaxConnections', description='The maximum number of connections to the Configserver node.', example='1000'),
          maxIOPS?: int32(name='MaxIOPS', description='The maximum IOPS of the Configserver node.', example='1000'),
          nodeClass?: string(name='NodeClass', description='The instance type of the Configserver node.', example='dds.cs.mid'),
          nodeDescription?: string(name='NodeDescription', description='The name of the Configserver node.', example='testConfigserver'),
          nodeId?: string(name='NodeId', description='The ID of the Configserver node.', example='dds-bp11483712c1****-cs'),
          nodeStorage?: int32(name='NodeStorage', description='The storage capacity of the Configserver node. Unit: GB.', example='20'),
          port?: int32(name='Port', description='The port number that is used to connect to the Configserver node.', example='3717'),
          status?: string(name='Status', description='The status of the Configserver node. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
        }
      ](name='ConfigserverAttribute')
      }(name='ConfigserverList', description='The details of the ConfigServer node.

>  This parameter is returned if the instance is a sharded cluster instance.'),
      creationTime?: string(name='CreationTime', description='The time when the instance was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-01-02T07:43:59Z'),
      currentKernelVersion?: string(name='CurrentKernelVersion', description='The minor version of the current database in the instance.', example='5.0.5-20220721143518_0'),
      DBInstanceClass?: string(name='DBInstanceClass', description='The instance type of the instance.', example='dds.mongo.mid'),
      DBInstanceDescription?: string(name='DBInstanceDescription', description='The name of the instance.', example='Test database'),
      DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp11483712c1****'),
      DBInstanceOrderStatus?: string(name='DBInstanceOrderStatus', description='The status of the orders generated for the instance. Valid values:

*   **all_completed**: All orders are being produced or complete.
*   **order_unpaid**: The instance has unpaid orders.
*   **order_wait_for_produce**: Orders are being delivered for production.

>  The order production process includes the following steps: place an order, pay for an order, deliver an order for production, produce an order, and complete the production.

*   If an order is in the **order_wait_for_produce** state for a long time, an error occurs when the order is being delivered for production. The system will automatically retry.
*   The instance status changes only when the order is in the producing and complete state, such as changing configurations and running.', example='all_completed'),
      DBInstanceReleaseProtection?: boolean(name='DBInstanceReleaseProtection', description='Indicates whether release protection is enabled for the instance. Valid values:

*   **true**
*   **false**', example='false'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='The status of the instance. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
      DBInstanceStorage?: int32(name='DBInstanceStorage', description='The storage capacity of the instance.', example='10'),
      DBInstanceType?: string(name='DBInstanceType', description='The architecture of the instance. Valid values:

*   **replicate**: replica set instance
*   **sharding**: sharded cluster instance', example='replicate'),
      destroyTime?: string(name='DestroyTime', description='The time when the instance data was destroyed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2021-12-10T16:00:00Z'),
      encrypted?: boolean(name='Encrypted', description='Indicates whether disk encryption is enabled.', example='true'),
      encryptionKey?: string(name='EncryptionKey', description='The Key Management Service (KMS) key used for disk encryption.', example='07609cc3-3109-408f-a35e-c548e776da0b'),
      engine?: string(name='Engine', description='The database engine of the instance.', example='MongoDB'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**', example='4.4'),
      expireTime?: string(name='ExpireTime', description='The time when the subscription instance expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.

>  This parameter is returned if the instance is a subscription instance.', example='2022-02-05T16:00Z'),
      hiddenZoneId?: string(name='HiddenZoneId', description='The ID of the secondary zone 2 of the instance. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hongkong Zone B
*   **cn-hongkong-c**: Hongkong Zone C
*   **cn-hongkong-d**: Hongkong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> 

*   This parameter is returned if the instance is a replica set or sharded cluster instance that runs MongoDB 4.4 or 5.0 and uses multi-zone deployment.

*   This parameter is returned only if you use the China site (aliyun.com).', example='cn-hangzhou-h'),
      kindCode?: string(name='KindCode', description='The kind code of the instance. Valid values:

*   **0**: physical machine
*   **1**: Elastic Compute Service (ECS) instance
*   **2**: Docker cluster
*   **18**: Kubernetes cluster', example='1'),
      lastDowngradeTime?: string(name='LastDowngradeTime', description='The date when the last downgrade operation was performed on the instance.', example='2022-01-08'),
      lockMode?: string(name='LockMode', description='The lock status of the instance. Valid values:

*   **Unlock**: The instance is not locked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before the instance is rolled back.
*   **LockByDiskQuota**: The instance is automatically locked after the storage space is exhausted.
*   **Released**: The instance is released.', example='Unlock'),
      maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. The time follows the ISO 8601 standard in the *HH:mm*Z format. The time is displayed in UTC.', example='03:00Z'),
      maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. The time follows the ISO 8601 standard in the *HH:mm*Z format. The time is displayed in UTC.', example='18:00Z'),
      maxConnections?: int32(name='MaxConnections', description='The maximum number of connections to the instance.', example='500'),
      maxIOPS?: int32(name='MaxIOPS', description='The maximum IOPS of the instance.', example='1000'),
      maxMBPS?: int32(name='MaxMBPS', description='The maximum MBPS of the instance.', example='350'),
      mongosList?: {
        mongosAttribute?: [ 
        {
          connectSting?: string(name='ConnectSting', description='The endpoint of the mongos node.', example='s-bp1d8c262a15****.mongodb.rds.aliyuncs.com'),
          connectString?: string(name='ConnectString', description='The endpoint of the mongos node.', example='s-bp1d8c262a15****.mongodb.rds.aliyuncs.com'),
          currentKernelVersion?: string(name='CurrentKernelVersion', description='The minor version of the current MongoDB kernel.', example='mongodb_20220518_4.0.21'),
          lockMode?: string(name='LockMode', description='The lock status of the instance. Valid values:

*   **Unlock**: The instance is not locked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before a rollback.
*   **LockByDiskQuota**: The instance is automatically locked because its storage capacity is exhausted and the instance is inaccessible.', example='Unlock'),
          maxConnections?: int32(name='MaxConnections', description='The maximum number of connections to the mongos node.', example='1000'),
          maxIOPS?: int32(name='MaxIOPS', description='The maximum IOPS of the mongos node.', example='800'),
          nodeClass?: string(name='NodeClass', description='The instance type of the mongos node.', example='dds.mongos.mid'),
          nodeDescription?: string(name='NodeDescription', description='The name of the mongos node.', example='mongos1'),
          nodeId?: string(name='NodeId', description='The ID of the mongos node.', example='s-bp1d8c262a15****'),
          port?: int32(name='Port', description='The port number that is used to connect to the mongos node.', example='3717'),
          status?: string(name='Status', description='The status of the mongos node. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
          VPCId?: string(name='VPCId', description='The VPC ID of the instance.

>  This parameter is returned if the network type of the instance is VPC.', example='vpc-bp1n3i15v90el48nx****'),
          vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the instance.

>  This parameter is returned if the network type of the instance is VPC.', example='vsw-bp1vj604nj5a9zz74****'),
          vpcCloudInstanceId?: string(name='VpcCloudInstanceId', description='The ID of the mongos node.', example='s-bp1d8c262a158****'),
        }
      ](name='MongosAttribute')
      }(name='MongosList', description='The details of the mongos node.

>  This parameter is returned if the instance is a sharded cluster instance.'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**: classic network
*   **VPC**: VPC', example='VPC'),
      protocolType?: string(name='ProtocolType', description='The access protocol type of the instance. Valid values:

*   **mongodb**
*   **dynamodb**

>  This parameter is returned if the instance is a sharded cluster instance.', example='mongodb'),
      provisionedIops?: long(name='ProvisionedIops', description='The provisioned performance of the ESSD AutoPL disk.', example='1960'),
      readonlyReplicas?: string(name='ReadonlyReplicas', description='The number of read-only nodes in the instance.', example='1'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      replacateId?: string(name='ReplacateId', description='The logical ID of the replica set instance.

>  ApsaraDB for MongoDB does not support new instances of this type. This parameter applies only to previous-version replica set instances.', example='bls-m****'),
      replicaSetName?: string(name='ReplicaSetName', description='The name of the replica set instance.

>  This parameter is returned if the instance is a replica set instance.', example='mgset-10ace****'),
      replicaSets?: {
        replicaSet?: [ 
        {
          connectionDomain?: string(name='ConnectionDomain', description='The endpoint of the node.', example='dds-bp11483712c1****.mongodb.rds.aliyuncs.com'),
          connectionPort?: string(name='ConnectionPort', description='The port number that is used to connect to the node.', example='3717'),
          networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**: classic network
*   **VPC**: VPC', example='VPC'),
          replicaSetRole?: string(name='ReplicaSetRole', description='The role of the node. Valid values:

*   **Primary**
*   **Secondary**', example='Primary'),
          VPCCloudInstanceId?: string(name='VPCCloudInstanceId', description='The instance ID.

>  This parameter is returned if the network type of the instance is VPC.', example='dds-bp11483712c1****'),
          VPCId?: string(name='VPCId', description='The VPC ID of the instance.

>  This parameter is returned if the network type of the instance is VPC.', example='vpc-bp1jk5vwkcri27qme****'),
          vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the instance.

>  This parameter is returned if the network type of the instance is virtual private cloud (VPC).', example='vpc-bp1jk5vwkcri27qme****'),
        }
      ](name='ReplicaSet')
      }(name='ReplicaSets', description='The information of the replica set instance.

>  This parameter is returned if the instance is a replica set instance.'),
      replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

>  This parameter is returned if the instance is a replica set instance.', example='3'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.

>  This parameter is returned only if you use the China site (aliyun.com).', example='rg-acfmyiu4ekp****'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone 1 of the instance. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hongkong Zone B
*   **cn-hongkong-c**: Hongkong Zone C
*   **cn-hongkong-d**: Hongkong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> 

*   This parameter is returned if the instance is a replica set or sharded cluster instance that runs MongoDB 4.4 or 5.0 and uses multi-zone deployment.

*   This parameter is returned only if you use the China site (aliyun.com).', example='cn-hangzhou-i'),
      shardList?: {
        shardAttribute?: [ 
        {
          connectString?: string(name='ConnectString', description='The endpoint of the shard node.', example='d-bp1af0680a9c6d3****.mongodb.rds.aliyuncs.com:****'),
          currentKernelVersion?: string(name='CurrentKernelVersion', description='The minor version of the current MongoDB kernel.', example='mongodb_20230613_4.0.25'),
          lockMode?: string(name='LockMode', description='The lock status of the shard node. Valid values:

*   **Unlock**: The instance is not locked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before a rollback.
*   **LockByDiskQuota**: The instance is automatically locked because its storage capacity is exhausted and the instance is inaccessible.', example='Unlock'),
          maxConnections?: int32(name='MaxConnections', description='The maximum number of connections to the shard node.', example='8000'),
          maxDiskMbps?: string(name='MaxDiskMbps', description='The maximum MBPS of the shard node.', example='350'),
          maxIOPS?: int32(name='MaxIOPS', description='The maximum IOPS of the shard node.', example='8000'),
          nodeClass?: string(name='NodeClass', description='The instance type of the shard node.', example='dds.shard.mid'),
          nodeDescription?: string(name='NodeDescription', description='The name of the shard node.', example='testshard'),
          nodeId?: string(name='NodeId', description='The ID of the shard node.', example='d-bp16e09d9c5d****'),
          nodeStorage?: int32(name='NodeStorage', description='The storage capacity of the shard node. Unit: GB.', example='10'),
          port?: int32(name='Port', description='The port number that is used to connect to the shard node.', example='3717'),
          readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard node. Valid values: **0** to **5**. The value must be an integer.', example='0'),
          status?: string(name='Status', description='The status of the shard node. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
        }
      ](name='ShardAttribute')
      }(name='ShardList', description='The details of the shard node.

>  This parameter is returned if the instance is a sharded cluster instance.'),
      storageEngine?: string(name='StorageEngine', description='The storage engine of the instance.', example='WiredTiger'),
      storageType?: string(name='StorageType', description='The storage type of the instance. Valid values:

**cloud_essd1**: ESSD PL1 **cloud_essd2**: ESSD PL2 **cloud_essd3**: ESSD PL3 **local_ssd**: local SSD **cloud_essd_dbfs_s**: DBFS disk', example='cloud_essd1'),
      syncPercent?: string(name='SyncPercent', description='The progress of data synchronization in percentage. When you are changing the configurations of the instance, you must synchronize the data of the instance. You can obtain the data synchronization progress based on the value returned for this parameter.', example='0.8'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='test'),
          value?: string(name='Value', description='The tag value.', example='api'),
        }
      ](name='Tag')
      }(name='Tags', description='The details of the instance tags.'),
      useClusterBackup?: boolean(name='UseClusterBackup', description='Indicates whether the cluster backup mode is enabled. Valid values:

*   **true**: The cluster backup mode is enabled.
*   **false**: The cluster backup mode is disabled.', example='true'),
      VPCCloudInstanceIds?: string(name='VPCCloudInstanceIds', description='The instance ID.

>  This parameter is returned if the network type of the instance is VPC.', example='dds-bp11483712c1****'),
      VPCId?: string(name='VPCId', description='The VPC ID of the instance.

>  This parameter is returned if the network type of the instance is VPC.', example='vpc-bp1n3i15v90el48nx****'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the instance.

>  This parameter is returned if the network type of the instance is VPC.', example='vsw-bp1oo2a7isyrb8igf****'),
      vpcAuthMode?: string(name='VpcAuthMode', description='Indicates whether password-free access within the VPC is enabled. Valid values:

*   **Open**: Password-free access within the VPC is enabled.
*   **Close**: Password-free access within the VPC is disabled, and you must use a password for access.
*   **NotSupport**: Password-free access within the VPC is not supported.', example='Open'),
      zoneId?: string(name='ZoneId', description='The ID of the zone in which the instance resides.', example='cn-hangzhou-b'),
    }
  ](name='DBInstance')
  }(name='DBInstances', description='The instance details.'),
  requestId?: string(name='RequestId', description='The request ID.', example='A935A8EE-A6CC-53DE-98BA-20ABAA7E632B'),
}

model DescribeDBInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttributeWithOptions(request: DescribeDBInstanceAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.isDelete)) {
    query['IsDelete'] = request.isDelete;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceAttribute',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstanceAttributeRequest
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttribute(request: DescribeDBInstanceAttributeRequest): DescribeDBInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceAttributeWithOptions(request, runtime);
}

model DescribeDBInstanceEncryptionKeyRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp2235****'),
  encryptionKey?: string(name='EncryptionKey', description='The custom key for the instance. You can call the [DescribeUserEncryptionKeyList](https://help.aliyun.com/document_detail/151729.html) operation to query the list of custom keys for an ApsaraDB for MongoDB instance.', example='2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceEncryptionKeyResponseBody = {
  creator?: string(name='Creator', description='The UID of the key creator.', example='123456'),
  deleteDate?: string(name='DeleteDate', description='The scheduled time when the key for the instance will be deleted. If the parameter is left empty, the key will not be deleted.', example='2020-07-06T18:22:03Z'),
  description?: string(name='Description', description='The description of the key for the instance.', example='key description example'),
  encryptionKey?: string(name='EncryptionKey', description='The key for the instance.', example='2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  encryptionKeyStatus?: string(name='EncryptionKeyStatus', description='Indicates whether the key for the instance is enabled. Valid values:

*   **Enabled**
*   **Disabled**', example='Enabled'),
  keyUsage?: string(name='KeyUsage', description='The purpose of the key for the instance.', example='ENCRYPT/DECRYPT'),
  materialExpireTime?: string(name='MaterialExpireTime', description='The expiration time of the key for the instance. The time is displayed in UTC. If the parameter is left empty, the key for the instance will not expire.', example='2020-07-06T18:22:03Z'),
  origin?: string(name='Origin', description='The source of the key for the instance.', example='Aliyun_KMS'),
  requestId?: string(name='RequestId', description='The request ID.', example='783C2062-A2D3-4EA8-88AD-E43F990C23BB'),
}

model DescribeDBInstanceEncryptionKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceEncryptionKeyResponseBody(name='body'),
}

/**
 * @summary Queries the details of a key for an ApsaraDB for MongoDB instance.
 *
 * @description When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html) operation to enable TDE.
 *
 * @param request DescribeDBInstanceEncryptionKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceEncryptionKeyResponse
 */
async function describeDBInstanceEncryptionKeyWithOptions(request: DescribeDBInstanceEncryptionKeyRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceEncryptionKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceEncryptionKey',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a key for an ApsaraDB for MongoDB instance.
 *
 * @description When you call the DescribeDBInstanceEncryptionKey operation, the instance must have transparent data encryption (TDE) enabled in BYOK mode. You can call the [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html) operation to enable TDE.
 *
 * @param request DescribeDBInstanceEncryptionKeyRequest
 * @return DescribeDBInstanceEncryptionKeyResponse
 */
async function describeDBInstanceEncryptionKey(request: DescribeDBInstanceEncryptionKeyRequest): DescribeDBInstanceEncryptionKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceEncryptionKeyWithOptions(request, runtime);
}

model DescribeDBInstanceMonitorRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp1143f90ff3****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceMonitorResponseBody = {
  granularity?: string(name='Granularity', description='The collection frequency of monitoring data for the instance. Valid value: **5**. Unit: seconds.', example='5'),
  requestId?: string(name='RequestId', description='The request ID.', example='EFD65226-08CC-4C4D-B6A4-CB3C382F67B0'),
}

model DescribeDBInstanceMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceMonitorResponseBody(name='body'),
}

/**
 * @summary Queries the collection frequency of monitoring data for an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstanceMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceMonitorResponse
 */
async function describeDBInstanceMonitorWithOptions(request: DescribeDBInstanceMonitorRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceMonitor',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the collection frequency of monitoring data for an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstanceMonitorRequest
 * @return DescribeDBInstanceMonitorResponse
 */
async function describeDBInstanceMonitor(request: DescribeDBInstanceMonitorRequest): DescribeDBInstanceMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceMonitorWithOptions(request, runtime);
}

model DescribeDBInstancePerformanceRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp2635****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2022-06-13T11:58Z'),
  interval?: string(name='Interval', description='The interval at which performance data is collected. Valid values: 5, 30, 60, 600, 1800, 3600, 86400.', example='60'),
  key?: string(name='Key', description='The performance metric. For more information about valid values, see [Monitoring items and metrics](https://help.aliyun.com/document_detail/216973.html).

>  If you need to specify multiple metrics, separate the metrics with commas (,).

This parameter is required.', example='CpuUsage'),
  nodeId?: string(name='NodeId', description='The ID of the mongos or shard node in a sharded cluster instance. You can specify this parameter to view the performance data of a single node.

>  This parameter is valid when you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='d-bp2287****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  replicaSetRole?: string(name='ReplicaSetRole', description='The role of the node in the standalone or replica set instance. Valid values:

*   **Primary**
*   **Secondary**

>  *  This parameter is valid only when you specify the **DBInstanceId** parameter to the ID of a standalone instance or a replica set instance.
> *  This parameter can be set only to **Primary** when you specify the **DBInstanceId** parameter to the ID of a standalone instance.', example='Primary'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleId?: string(name='RoleId', description='The role ID of the node in a standalone or replica set instance. You can call the [DescribeReplicaSetRole](https://help.aliyun.com/document_detail/62134.html) operation to query the role ID of the node.

>  This parameter is available when you set the **DBInstanceId** parameter to the ID of a standalone instance or a replica set instance.', example='6025****'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2022-06-13T10:58Z'),
}

model DescribeDBInstancePerformanceResponseBody = {
  endTime?: string(name='EndTime', description='The end of the queried time range. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.', example='2022-06-13T11:58Z'),
  performanceKeys?: {
    performanceKey?: [ 
    {
      key?: string(name='Key', description='The performance metrics that are returned.', example='CpuUsage'),
      performanceValues?: {
        performanceValue?: [ 
        {
          date?: string(name='Date', description='The date and time when the metric value was generated.', example='2022-06-13T10:58:00Z'),
          value?: string(name='Value', description='The value of the performance metric.', example='0.23'),
        }
      ](name='PerformanceValue')
      }(name='PerformanceValues', description='The details of the performance metric values.'),
      unit?: string(name='Unit', description='The unit of the performance metric.', example='%'),
      valueFormat?: string(name='ValueFormat', description='The format of the performance metric value. If the performance metric contains multiple fields, the fields are separated with ampersands ( &).

For example, if you query disk space usage, the returned value of the **ValueFormat** parameter is **ins_size\\\\&data_size\\\\&log_size**.', example='cpu_usage'),
    }
  ](name='PerformanceKey')
  }(name='PerformanceKeys', description='The details of performance metrics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4A300BC7-6D8F-527F-A2DB-A7768D26E9AC'),
  startTime?: string(name='StartTime', description='The beginning of the queried time range. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.', example='2022-06-13T10:58Z'),
}

model DescribeDBInstancePerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstancePerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the performance data of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstancePerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstancePerformanceResponse
 */
async function describeDBInstancePerformanceWithOptions(request: DescribeDBInstancePerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBInstancePerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.replicaSetRole)) {
    query['ReplicaSetRole'] = request.replicaSetRole;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstancePerformance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the performance data of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeDBInstancePerformanceRequest
 * @return DescribeDBInstancePerformanceResponse
 */
async function describeDBInstancePerformance(request: DescribeDBInstancePerformanceRequest): DescribeDBInstancePerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancePerformanceWithOptions(request, runtime);
}

model DescribeDBInstanceSSLRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceSSLResponseBody = {
  certCommonName?: string(name='CertCommonName', description='The name of the SSL certificate.', example='dds-bpxxxxxxxx.mongodb.rds.aliyuncs.com'),
  requestId?: string(name='RequestId', description='The request ID.', example='36BB1BC2-789C-4BBA-A519-C5B388E4B0D4'),
  SSLExpiredTime?: string(name='SSLExpiredTime', description='The time when the SSL certificate expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in Coordinated Universal Time (UTC).', example='2020-03-11T02:28:25Z'),
  SSLStatus?: string(name='SSLStatus', description='The status of the SSL feature. Valid values:

*   **Open**: The SSL feature is enabled.
*   **Closed**: The SSL feature is disabled.', example='Open'),
}

model DescribeDBInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceSSLResponseBody(name='body'),
}

/**
 * @summary Queries the Secure Sockets Layer (SSL) settings of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the Running state.
 * *   The instance is a replica set instance.
 * *   The instance runs MongoDB 3.4 or later.
 *
 * @param request DescribeDBInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceSSLResponse
 */
async function describeDBInstanceSSLWithOptions(request: DescribeDBInstanceSSLRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceSSLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceSSL',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the Secure Sockets Layer (SSL) settings of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the Running state.
 * *   The instance is a replica set instance.
 * *   The instance runs MongoDB 3.4 or later.
 *
 * @param request DescribeDBInstanceSSLRequest
 * @return DescribeDBInstanceSSLResponse
 */
async function describeDBInstanceSSL(request: DescribeDBInstanceSSLRequest): DescribeDBInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceSSLWithOptions(request, runtime);
}

model DescribeDBInstanceSpecInfoRequest {
  instanceClass?: string(name='InstanceClass', description='This parameter is required.', example='mdb.shard.4x.large.d'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeDBInstanceSpecInfoResponseBody = {
  CPU?: string(name='CPU', example='2'),
  description?: string(name='Description'),
  memory?: string(name='Memory', example='8'),
  requestId?: string(name='RequestId', example='6B82A9EF-9961-5A31-A19F-009B709xxxxx'),
}

model DescribeDBInstanceSpecInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceSpecInfoResponseBody(name='body'),
}

/**
 * @summary 查看规格信息详情
 *
 * @param request DescribeDBInstanceSpecInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceSpecInfoResponse
 */
async function describeDBInstanceSpecInfoWithOptions(request: DescribeDBInstanceSpecInfoRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceSpecInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceSpecInfo',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查看规格信息详情
 *
 * @param request DescribeDBInstanceSpecInfoRequest
 * @return DescribeDBInstanceSpecInfoResponse
 */
async function describeDBInstanceSpecInfo(request: DescribeDBInstanceSpecInfoRequest): DescribeDBInstanceSpecInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceSpecInfoWithOptions(request, runtime);
}

model DescribeDBInstanceSwitchLogRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-uf68f1b5a57exxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm*Z format. The time must be in UTC. The end time must be later than the start time.', example='2023-05-28T02:00Z'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0 and less than or equal to the maximum value supported by the integer data type. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30, 50, and 100**. Default value: **30**.', example='30'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm*Z format. The time must be in UTC.', example='2023-05-27T02:46Z'),
}

model DescribeDBInstanceSwitchLogResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-uf68f1b5a57exxxx'),
  logItems?: [ 
    {
      nodeId?: string(name='NodeId', description='The ID of the replica set instance or the ID of the node on which a primary/secondary switchover is performed.', example='dds-uf68f1b5a57exxxx'),
      switchCode?: string(name='SwitchCode', description='The code that indicates the reason of a primary/secondary switchover. Valid values:

*   USER_CONSOLE_OPERATION: The switchover is manually performed.
*   OPERATION_AND_MAINTENANCE: Potential risks exist.
*   MACHINE_DOWNTIME: The host is offline.
*   PRIMARY_UNHEALTHY: An exception occurs on the primary node of the instance.
*   SECONDARY_UNHEALTHY: An exception occurs on the secondary node of the instance.
*   MULTIPLE_NODE_FAILURES: An exception occurs on multiple nodes of the instance.', example='USER_CONSOLE_OPERATION'),
      switchStatus?: string(name='SwitchStatus', description='The switchover status. Valid values: **1** and **0**. The value 1 indicates a successful primary/secondary switchover and the value 0 indicates a failed primary/secondary switchover.', example='1'),
      switchTime?: string(name='SwitchTime', description='The point in time when a primary/secondary switchover was performed. The time follows the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2023-02-07T18:00:00Z'),
    }
  ](name='LogItems', description='The primary/secondary switchover logs.'),
  pageNumber?: long(name='PageNumber', description='The page number returned.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='ECBCA991-XXXX-XXXX-834C-B3E8007F33AA'),
  totalCount?: long(name='TotalCount', description='The number of primary/secondary switching entries.', example='1'),
}

model DescribeDBInstanceSwitchLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceSwitchLogResponseBody(name='body'),
}

/**
 * @summary Queries the primary/secondary switching logs of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The instance uses local physical disks to store data.
 *
 * @param request DescribeDBInstanceSwitchLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceSwitchLogResponse
 */
async function describeDBInstanceSwitchLogWithOptions(request: DescribeDBInstanceSwitchLogRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceSwitchLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceSwitchLog',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the primary/secondary switching logs of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The instance uses local physical disks to store data.
 *
 * @param request DescribeDBInstanceSwitchLogRequest
 * @return DescribeDBInstanceSwitchLogResponse
 */
async function describeDBInstanceSwitchLog(request: DescribeDBInstanceSwitchLogRequest): DescribeDBInstanceSwitchLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceSwitchLogWithOptions(request, runtime);
}

model DescribeDBInstanceTDEInfoRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceTDEInfoResponseBody = {
  encryptionKey?: string(name='EncryptionKey', description='实例的自定义密钥。

目前仅以下地域支持BYOK（Bring Your Own Key，用户可以自行管理和拥有加密密钥）：
- 华东1（杭州）
- 华东2（上海）
- 华北2（北京）
- 华南1（深圳）
- 中国（香港）
- 新加坡
- 马来西亚（吉隆坡）

> 支持BYOK，用户可以管理且拥有密钥，系统将返回用户的自定义密钥；不支持BYOK，用户不可管理密钥，系统将返回字符串`NoActiveBYOK`。', example='2axxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  encryptorName?: string(name='EncryptorName', description='加密算法。', example='aes-256-cbc'),
  requestId?: string(name='RequestId', description='The request ID.', example='F4DD0E29-361B-42F2-9301-B0048CCCE5D6'),
  roleARN?: string(name='RoleARN', description='指定待授权角色的全局资源描述符ARN（Alibaba Cloud Resource Name）信息。', example='acs:ram::123456789012****:role/aliyunrdsinstanceencryptiondefaultrole'),
  TDEStatus?: string(name='TDEStatus', description='The TDE status. Valid values:

*   **enabled**
*   **disabled**', example='enabled'),
}

model DescribeDBInstanceTDEInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceTDEInfoResponseBody(name='body'),
}

/**
 * @summary Queries whether Transparent Data Encryption (TDE) is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description >  For more information about TDE, see [TDE](https://help.aliyun.com/document_detail/131048.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The storage engine of the instance is WiredTiger.
 * *   The database engine version of the instance is 4.0 or 4.2. If the database engine version is earlier than 4.0, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine.
 *
 * @param request DescribeDBInstanceTDEInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceTDEInfoResponse
 */
async function describeDBInstanceTDEInfoWithOptions(request: DescribeDBInstanceTDEInfoRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceTDEInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceTDEInfo',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries whether Transparent Data Encryption (TDE) is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description >  For more information about TDE, see [TDE](https://help.aliyun.com/document_detail/131048.html).
 * Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The storage engine of the instance is WiredTiger.
 * *   The database engine version of the instance is 4.0 or 4.2. If the database engine version is earlier than 4.0, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine.
 *
 * @param request DescribeDBInstanceTDEInfoRequest
 * @return DescribeDBInstanceTDEInfoResponse
 */
async function describeDBInstanceTDEInfo(request: DescribeDBInstanceTDEInfoRequest): DescribeDBInstanceTDEInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceTDEInfoWithOptions(request, runtime);
}

model DescribeDBInstancesRequest {
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
  connectionDomain?: string(name='ConnectionDomain', description='The endpoint of the node. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the endpoint of the node.', example='dds-bp1ea17b41abecf43****.mongodb.rds.aliyuncs.com'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The instance type. For more information about valid values, see [Instance types](https://help.aliyun.com/document_detail/57141.html).', example='dds.mongo.mid'),
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The name of the instance. The name must meet the following requirements:

*   The name must start with a letter.
*   It can contain digits, letters, underscores (_), and hyphens (-).
*   It must be 2 to 256 characters in length.', example='Test database'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp199659b178****'),
  DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the instance. For more information about valid values, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
  DBInstanceType?: string(name='DBInstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='sharding'),
  DBNodeType?: string(name='DBNodeType', description='The type of the node in the instance. This parameter is used to filter standard or test instance.

1.  Valid value for a standalone or DBFS instance.
2.  Valid value for a standard instance that comes in the replica set or sharded cluster architecture: standard
3.  Valid value when all instances are displayed: default', example='default'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.', example='MongoDB'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.

*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.0'),
  expireTime?: string(name='ExpireTime', description='The time when the instance expires.', example='2019-12-26T16:00Z'),
  expired?: string(name='Expired', description='Specifies whether the instance has expired. Valid values:

*   **true**
*   **false**', example='true'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**
*   **VPC**', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value of this parameter must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the replica set instance. Valid values:

*   **3**
*   **5**
*   **7**', example='3'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the instance. Valid values of N: **1** to **20**.

*   The key cannot start with `aliyun`, `acs:`, `http://`, or `https://`.
*   It can be up to 64 characters in length.
*   It cannot be an empty string.', example='testdatabase'),
      value?: string(name='Value', description='The tag value of the instance. Valid values of N: **1** to **20**.

*   The value cannot start with `aliyun`, `acs:`, `http://`, or `https://`.
*   The value can be up to 128 characters in length.
*   It can be an empty string.', example='apitest'),
    }
  ](name='Tag', description='The tags of the instance.'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the instance.', example='vsw-bp1vj604nj5a9zz74****'),
  vpcId?: string(name='VpcId', description='The VPC ID of the instance.', example='vpc-bp1n3i15v90el48nx****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent zone list.', example='cn-hangzhou-b'),
}

model DescribeDBInstancesResponseBody = {
  DBInstances?: {
    DBInstance?: [ 
    {
      backupRetentionPolicy?: int32(name='BackupRetentionPolicy', description='The backup retention policy configured for the instance. Valid values:

*   **0**: All backup sets of the instance are immediately deleted when the instance is released.
*   **1**: A backup set of the instance is automatically backed up and retained for a long period of time when the instance is released.
*   **2**: All backup sets of the instance are automatically backed up and retained for a long period of time when the instance is released.', example='1'),
      capacityUnit?: string(name='CapacityUnit', description='The I/O throughput consumed by the instance.

>  This parameter is required only when the instance is a serverless instance.', example='100'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid:** pay-as-you-go', example='PrePaid'),
      creationTime?: string(name='CreationTime', description='The time when the instance was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2021-03-25T02:18:00Z'),
      DBInstanceClass?: string(name='DBInstanceClass', description='The instance type of the instance.', example='dds.mongo.mid'),
      DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the instance.', example='Test database'),
      DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp18b0934e70****'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='The status of the instance. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
      DBInstanceStorage?: int32(name='DBInstanceStorage', description='The storage capacity of the instance.', example='20'),
      DBInstanceType?: string(name='DBInstanceType', description='The architecture of the instance.

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='sharding'),
      destroyTime?: string(name='DestroyTime', description='The time when the instance data is destroyed. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.

> *   For a subscription instance, the computing resources of the instance are released on the 16th day after expiration, and the data of the instance is retained for seven days. The data is deleted on the 23th day after expiration and cannot be restored.
> *   For a pay-as-you-go instance, the computing resources of the instance are released on the 16th day after the payment becomes overdue, and the data of the instance is retained for seven days. The data is deleted on the 23th day after the payment becomes overdue and cannot be restored.', example='2021-12-10T16:00:00Z'),
      engine?: string(name='Engine', description='The engine of the instance.', example='MongoDB'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values:

*   **7.0**
*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.2'),
      expireTime?: string(name='ExpireTime', description='The time when the instance expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.', example='2021-11-25T16:00Z'),
      hiddenZoneId?: string(name='HiddenZoneId', description='The secondary zone 2 of the instance in the multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hong Kong Zone B
*   **cn-hongkong-c**: Hong Kong Zone C
*   **cn-hongkong-d**: Hong Kong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> *   This parameter is returned only when the instance is a replica set or sharded cluster instance that runs MongoDB 4.4 or 5.0 and uses the multi-zone deployment.
> *   This parameter is returned only if you use the China site (aliyun.com).', example='cn-hangzhou-h'),
      kindCode?: string(name='KindCode', description='The kind code of the instance. Valid values:

*   **0**: physical machine
*   **1**: Elastic Compute Service (ECS) instance
*   **2**: Docker cluster
*   **18**: Kubernetes cluster', example='1'),
      lastDowngradeTime?: string(name='LastDowngradeTime', description='The date when the last downgrade operation was performed.', example='2021-05-08'),
      lockMode?: string(name='LockMode', description='The lock status of the instance. Valid values:

*   **Unlock**: The cluster is unlocked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before it is rolled back.
*   **LockByDiskQuota**: The instance is automatically locked after the storage space is exhausted.
*   **Released**: The instance is released. After an instance is released, the instance cannot be unlocked. You can only restore the backup data of the instance to a new instance. This process requires a long period of time.', example='Unlock'),
      mongosList?: {
        mongosAttribute?: [ 
        {
          nodeClass?: string(name='NodeClass', description='The instance type of the mongos node.', example='dds.mongos.standard'),
          nodeDescription?: string(name='NodeDescription', description='The description of the mongos node.', example='testmongosnode'),
          nodeId?: string(name='NodeId', description='The ID of the mongos node.', example='s-bp10e3b0d02f****'),
        }
      ](name='MongosAttribute')
      }(name='MongosList', description='The details of the mongos node.

>  This parameter is returned if the instance is a sharded cluster instance.'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**: classic network
*   **VPC**: VPC', example='Classic'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      releaseTime?: string(name='ReleaseTime', description='The time when the instance was released.', example='2024-06-17T07:01Z'),
      replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

>  This parameter is returned if the instance is a replica set instance.', example='3'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfmyiu4ekp****'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The secondary zone 1 of the instance in the multi-zone deployment. Valid values:

*   **cn-hangzhou-g**: Hangzhou Zone G
*   **cn-hangzhou-h**: Hangzhou Zone H
*   **cn-hangzhou-i**: Hangzhou Zone I
*   **cn-hongkong-b**: Hong Kong Zone B
*   **cn-hongkong-c**: Hong Kong Zone C
*   **cn-hongkong-d**: Hong Kong Zone D
*   **cn-wulanchabu-a**: Ulanqab Zone A
*   **cn-wulanchabu-b**: Ulanqab Zone B
*   **cn-wulanchabu-c**: Ulanqab Zone C
*   **ap-southeast-1a**: Singapore Zone A
*   **ap-southeast-1b**: Singapore Zone B
*   **ap-southeast-1c**: Singapore Zone C
*   **ap-southeast-5a**: Jakarta Zone A
*   **ap-southeast-5b**: Jakarta Zone B
*   **ap-southeast-5c**: Jakarta Zone C
*   **eu-central-1a**: Frankfurt Zone A
*   **eu-central-1b**: Frankfurt Zone B
*   **eu-central-1c**: Frankfurt Zone C

> *   This parameter is returned only when the instance is a replica set or sharded cluster instance that runs MongoDB 4.4 or 5.0 and uses the multi-zone deployment.
> *   This parameter is returned only if you use the China site (aliyun.com).', example='cn-hangzhou-i'),
      shardList?: {
        shardAttribute?: [ 
        {
          nodeClass?: string(name='NodeClass', description='The instance type of the shard node.', example='dds.shard.mid'),
          nodeDescription?: string(name='NodeDescription', description='The description of the shard node.', example='testshardnode'),
          nodeId?: string(name='NodeId', description='The ID of the shard node.', example='d-bp1cac6f2083****'),
          nodeStorage?: int32(name='NodeStorage', description='The storage capacity of the shard node. Unit: GB.', example='10'),
          readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard node. Valid values: **0** to **5**.', example='2'),
        }
      ](name='ShardAttribute')
      }(name='ShardList', description='The details of the shard node.

>  This parameter is returned if the instance is a sharded cluster instance.'),
      storageType?: string(name='StorageType', description='The storage type of the instance. Valid values:

*   **cloud_essd**: Enterprise SSD (ESSD)
*   **local_ssd**: local SSD', example='local_ssd'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='test'),
          value?: string(name='Value', description='The tag value.', example='api'),
        }
      ](name='Tag')
      }(name='Tags', description='The details of the tag.'),
      vpcAuthMode?: string(name='VpcAuthMode', description='Indicates whether password-free access over virtual private cloud (VPC) is enabled. Valid values:

*   **Open**: Password-free access over VPC is enabled.
*   **Close**: Password-free access over VPC is disabled.', example='Close'),
      zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-g'),
    }
  ](name='DBInstance')
  }(name='DBInstances', description='The details of the instance.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='0E4FE33F-5510-5758-8FA7-A6672CDE****'),
  totalCount?: int32(name='TotalCount', description='The number of instances in the query results.', example='5'),
}

model DescribeDBInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstancesResponseBody(name='body'),
}

/**
 * @summary Queries a list of ApsaraDB for MongoDB instances.
 *
 * @description The list of replica set and standalone instances is displayed when the **DBInstanceType** parameter uses the default value **replicate**. To query a list of sharded cluster instances, you must set the **DBInstanceType** parameter to **sharding**.
 *
 * @param request DescribeDBInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstancesWithOptions(request: DescribeDBInstancesRequest, runtime: Util.RuntimeOptions): DescribeDBInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.connectionDomain)) {
    query['ConnectionDomain'] = request.connectionDomain;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBInstanceStatus)) {
    query['DBInstanceStatus'] = request.DBInstanceStatus;
  }
  if (!Util.isUnset(request.DBInstanceType)) {
    query['DBInstanceType'] = request.DBInstanceType;
  }
  if (!Util.isUnset(request.DBNodeType)) {
    query['DBNodeType'] = request.DBNodeType;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.expireTime)) {
    query['ExpireTime'] = request.expireTime;
  }
  if (!Util.isUnset(request.expired)) {
    query['Expired'] = request.expired;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstances',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of ApsaraDB for MongoDB instances.
 *
 * @description The list of replica set and standalone instances is displayed when the **DBInstanceType** parameter uses the default value **replicate**. To query a list of sharded cluster instances, you must set the **DBInstanceType** parameter to **sharding**.
 *
 * @param request DescribeDBInstancesRequest
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstances(request: DescribeDBInstancesRequest): DescribeDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancesWithOptions(request, runtime);
}

model DescribeDBInstancesOverviewRequest {
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PostPaid'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values: **5.0**, **4.4**, **4.2**, **4.0**, and **3.4**.', example='4.0'),
  instanceClass?: string(name='InstanceClass', description='The instance type. The instance type varies based on the instance architecture. For more information about instance types supported by different instance architectures, see the following references:

*   [Standalone instance types](https://help.aliyun.com/document_detail/311407.html)
*   [Replica set instance types](https://help.aliyun.com/document_detail/311410.html)
*   [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html)', example='dds.mongo.2xlarge'),
  instanceIds?: string(name='InstanceIds', description='The ID of the instance for which you want to query the overview information.

> 

*   If you do not specify this parameter, the overview information of all instances within this account is queried.

*   Separate the instance IDs with commas (,).', example='dds-bp12c5b040dc****'),
  instanceStatus?: string(name='InstanceStatus', description='The state of the instance. For more information about valid values, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
  instanceType?: string(name='InstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance

> 

*   To query the overview information of a sharded cluster instance, you must set the parameter to **sharding**.

*   If you do not specify this parameter, the overview information of all instances within this account is queried.', example='replicate'),
  networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**: classic network
*   **VPC**: Virtual Private Cloud (VPC)', example='Classic'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs. For more information, see [View the basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  showTags?: boolean(name='ShowTags', description='Specifies whether to display instance tags. Default value: False.', example='false'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch to which the instance is connected.', example='vsw-bp1e7clcw529l773d****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC in which the instance is deployed.', example='vpc-bp1nme44gek34slfc****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-b'),
}

model DescribeDBInstancesOverviewResponseBody = {
  DBInstances?: [ 
    {
      capacityUnit?: string(name='CapacityUnit', description='The read and write throughput consumed by the instance.

> 

*   This parameter is returned when the instance is a serverless instance.

*   Serverless instances are available only in the China site (aliyun.com).', example='100'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid**: subscription
*   **PostPaid**: pay-as-you-go', example='PrePaid'),
      creationTime?: string(name='CreationTime', description='The time when the instance was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2022-01-05T03:18:53Z'),
      DBInstanceClass?: string(name='DBInstanceClass', description='The instance type. The instance type varies based on the instance architecture. For more information about instance types supported by different instance architectures, see the following references:

*   [Standalone instance types](https://help.aliyun.com/document_detail/311407.html)
*   [Replica set instance types](https://help.aliyun.com/document_detail/311410.html)
*   [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html)', example='dds.mongo.mid'),
      DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the instance.', example='test db'),
      DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp12c5b040dc****'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the instance. For more information about valid values, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
      DBInstanceStorage?: int32(name='DBInstanceStorage', description='The storage space of the instance. Unit: GB.', example='20'),
      DBInstanceType?: string(name='DBInstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='replicate'),
      destroyTime?: string(name='DestroyTime', description='The time when the instance data was destroyed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2021-12-10T16:00:00Z'),
      engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.', example='MongoDB'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='4.2'),
      expireTime?: string(name='ExpireTime', description='The time when the instance expires. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time is displayed in UTC.', example='2022-02-05T16:00Z'),
      kindCode?: string(name='KindCode', description='The kind code of the instance. Valid values:

*   **0**: physical machine
*   **1**: Elastic Compute Service (ECS) instance
*   **2**: Docker cluster
*   **18**: Kubernetes cluster', example='0'),
      lastDowngradeTime?: string(name='LastDowngradeTime', description='The date when the last downgrade operation was performed.', example='2021-05-08'),
      lockMode?: string(name='LockMode', description='Indicates whether the instance is locked. Valid values:

*   **Unlock**: The instance is not locked.
*   **ManualLock**: The instance is manually locked.
*   **LockByExpiration**: The instance is automatically locked due to instance expiration.
*   **LockByRestoration**: The instance is automatically locked before it is rolled back.
*   **LockByDiskQuota**: The instance is automatically locked after the storage space is exhausted.
*   **Released**: The instance is released. After an instance is released, the instance cannot be unlocked. You can only restore the backup data of the instance to a new instance. This process requires a long period of time.', example='Unlock'),
      mongosList?: [ 
        {
          nodeClass?: string(name='NodeClass', description='The instance type of the mongos node.', example='dds.mongos.standard'),
          nodeDescription?: string(name='NodeDescription', description='The description of the mongos node.', example='mongos node describe.'),
          nodeId?: string(name='NodeId', description='The ID of the mongos node.', example='s-bp10e3b0d02f****'),
        }
      ](name='MongosList', description='The details of the mongos nodes.

>  This parameter is returned when the instance is a sharded cluster instance.'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **Classic**
*   **VPC**', example='VPC'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

>  This parameter is returned when the instance is a replica set instance.', example='3'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-acfm22cdcgc****'),
      shardList?: [ 
        {
          nodeClass?: string(name='NodeClass', description='The instance type of the shard node.', example='dds.shard.mid'),
          nodeDescription?: string(name='NodeDescription', description='The description of the shard node.', example='testshard'),
          nodeId?: string(name='NodeId', description='The ID of the shard node.', example='d-bp1cac6f2083****'),
          nodeStorage?: int32(name='NodeStorage', description='The storage space of the shard node. Unit: GB.', example='10'),
          readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard node. Valid values: **0** to **5**.', example='2'),
        }
      ](name='ShardList', description='The details of the shard nodes.

>  This parameter is returned when the instance is a sharded cluster instance.'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. Valid values of N: **1** to **20**.

*   The key cannot start with `aliyun`, `acs:`, `http://`, or `https://`.
*   It can be up to 64 characters in length.
*   It cannot be an empty string.', example='testdatabase'),
          value?: string(name='Value', description='The tag value. Valid values of N: **1** to **20**.

*   The value cannot start with `aliyun`, `acs:`, `http://`, or `https://`.
*   The value can be up to 128 characters in length.
*   The value can be an empty string.', example='apitest'),
        }
      ](name='Tags', description='The tags to add to the instance.'),
      vpcAuthMode?: string(name='VpcAuthMode', description='Indicates whether password-free access over VPC is enabled. Valid values:

*   **Open**: Password-free access over VPC is enabled.
*   **Close**: Password-free access over VPC is disabled.', example='Open'),
      zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-i'),
    }
  ](name='DBInstances', description='The information of instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='52820D2B-B2DD-59F0-BDF2-83EC19C6F1CA'),
  totalCount?: string(name='TotalCount', description='The number of instances in the query results.', example='1'),
}

model DescribeDBInstancesOverviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstancesOverviewResponseBody(name='body'),
}

/**
 * @summary Queries the overview information of one or more ApsaraDB for MongoDB instances.
 *
 * @description *   If you do not specify an instance when you call this operation, the overview information of all instances in a specific region within this account is returned.
 * *   Paged query is disabled for this operation.
 *
 * @param request DescribeDBInstancesOverviewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstancesOverviewResponse
 */
async function describeDBInstancesOverviewWithOptions(request: DescribeDBInstancesOverviewRequest, runtime: Util.RuntimeOptions): DescribeDBInstancesOverviewResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.instanceClass)) {
    query['InstanceClass'] = request.instanceClass;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.instanceStatus)) {
    query['InstanceStatus'] = request.instanceStatus;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.showTags)) {
    query['ShowTags'] = request.showTags;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstancesOverview',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the overview information of one or more ApsaraDB for MongoDB instances.
 *
 * @description *   If you do not specify an instance when you call this operation, the overview information of all instances in a specific region within this account is returned.
 * *   Paged query is disabled for this operation.
 *
 * @param request DescribeDBInstancesOverviewRequest
 * @return DescribeDBInstancesOverviewResponse
 */
async function describeDBInstancesOverview(request: DescribeDBInstancesOverviewRequest): DescribeDBInstancesOverviewResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancesOverviewWithOptions(request, runtime);
}

model DescribeErrorLogRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp12c5b040dc****'),
  DBName?: string(name='DBName', description='The name of the database.', example='mongodbtest'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time and within 24 hours from the start time. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-01-02T12:10Z'),
  logicalOperator?: string(name='LogicalOperator', description='The logical relationship between multiple keywords. Valid values:

*   **or**
*   **and** (default value)', example='and'),
  nodeId?: string(name='NodeId', description='The ID of the mongos node or shard node whose error logs you want to query in the instance. If the instance is a sharded cluster instance, you must specify this parameter.

>  This parameter is valid only when **DBInstanceId** is set to the ID of a sharded cluster instance.', example='d-bp128a003436****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30** to **100**.', example='30'),
  queryKeywords?: string(name='QueryKeywords', description='The keywords used for query. You can enter up to 10 keywords at a time. If you enter multiple keywords, separate the keywords with spaces.', example='test test1'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleType?: string(name='RoleType', description='The role of the node whose error logs you want to query in the instance. Valid values:

*   **primary**
*   **secondary**

>  If you set the **NodeId** parameter to the ID of a mongos node, the RoleType parameter must be set to **primary**.', example='primary'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-01-01T12:10Z'),
}

model DescribeErrorLogRecordsResponseBody = {
  engine?: string(name='Engine', description='The database engine.', example='MongoDB'),
  items?: {
    logRecords?: [ 
    {
      category?: string(name='Category', description='The category of the log entry. Valid values:

*   NETWORK: network connection log
*   ACCESS: access control log
*   \\\\-: general log
*   COMMAND: slow query log
*   SHARDING: sharded cluster log
*   STORAGE: storage engine log
*   CONNPOOL: connection pool log
*   ASIO: asynchronous I/O operation log
*   WRITE: slow update log', example='NETWORK'),
      connInfo?: string(name='ConnInfo', description='The connection information of the log entry.', example='conn18xxxxxx'),
      content?: string(name='Content', description='The content of the log entry.', example='xxxxxxxx'),
      createTime?: string(name='CreateTime', description='The time when the log entry was generated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-26T12:09:34Z'),
      id?: int32(name='Id', description='The ID of the log entry.', example='1111111111'),
    }
  ](name='LogRecords')
  }(name='Items', description='Details about the log entries returned.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries returned per page.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='68BCBEC2-1E66-471F-A1A8-E3C60C0A80B0'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries.', example='1'),
}

model DescribeErrorLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeErrorLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries entries in error logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeErrorLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeErrorLogRecordsResponse
 */
async function describeErrorLogRecordsWithOptions(request: DescribeErrorLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeErrorLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.logicalOperator)) {
    query['LogicalOperator'] = request.logicalOperator;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryKeywords)) {
    query['QueryKeywords'] = request.queryKeywords;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeErrorLogRecords',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries entries in error logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeErrorLogRecordsRequest
 * @return DescribeErrorLogRecordsResponse
 */
async function describeErrorLogRecords(request: DescribeErrorLogRecordsRequest): DescribeErrorLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeErrorLogRecordsWithOptions(request, runtime);
}

model DescribeGlobalSecurityIPGroupRequest {
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-hedmu8kg9nsabw6u42rv'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeGlobalSecurityIPGroupResponseBody = {
  globalSecurityIPGroup?: [ 
    {
      DBInstances?: [ string ](name='DBInstances', description='The instances associated with the global whitelist template.'),
      GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

> Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP address whitelists.', example='117.12.202.19'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='dev_baoxian_k8s_bj'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-sdgwqyp4f5j1x3qk7yvm'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
    }
  ](name='GlobalSecurityIPGroup', description='The global IP whitelist templates.'),
  requestId?: string(name='RequestId', description='The unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='72651AF9-7897-41A7-8B67-6C15C7F26A0A'),
}

model DescribeGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Queries the global IP whitelist template of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGlobalSecurityIPGroupResponse
 */
async function describeGlobalSecurityIPGroupWithOptions(request: DescribeGlobalSecurityIPGroupRequest, runtime: Util.RuntimeOptions): DescribeGlobalSecurityIPGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGlobalSecurityIPGroup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the global IP whitelist template of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRequest
 * @return DescribeGlobalSecurityIPGroupResponse
 */
async function describeGlobalSecurityIPGroup(request: DescribeGlobalSecurityIPGroupRequest): DescribeGlobalSecurityIPGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGlobalSecurityIPGroupWithOptions(request, runtime);
}

model DescribeGlobalSecurityIPGroupRelationRequest {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.

This parameter is required.', example='dds-2ze6069764423m0l'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeGlobalSecurityIPGroupRelationResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.', example='dds-2ze6069764423m0l'),
  globalSecurityIPGroupRel?: [ 
    {
      GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

>  Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP whitelists.', example='27.16.214.10,111.60.117.181'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='dev_baoxian_k8s_bj'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-gfurfpsh4ycbrm2avst7'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hongkong'),
    }
  ](name='GlobalSecurityIPGroupRel', description='The global IP whitelist templates associated with the instance.'),
  requestId?: string(name='RequestId', description='The unique ID of the request. If the request fails, provide this ID for technical support to troubleshoot the failure.', example='F8CA8312-530A-413A-9129-F2BB32A8D404'),
}

model DescribeGlobalSecurityIPGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGlobalSecurityIPGroupRelationResponseBody(name='body'),
}

/**
 * @summary Queries the global IP whitelist templates associated with an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGlobalSecurityIPGroupRelationResponse
 */
async function describeGlobalSecurityIPGroupRelationWithOptions(request: DescribeGlobalSecurityIPGroupRelationRequest, runtime: Util.RuntimeOptions): DescribeGlobalSecurityIPGroupRelationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGlobalSecurityIPGroupRelation',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the global IP whitelist templates associated with an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeGlobalSecurityIPGroupRelationRequest
 * @return DescribeGlobalSecurityIPGroupRelationResponse
 */
async function describeGlobalSecurityIPGroupRelation(request: DescribeGlobalSecurityIPGroupRelationRequest): DescribeGlobalSecurityIPGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGlobalSecurityIPGroupRelationWithOptions(request, runtime);
}

model DescribeHistoryTasksRequest {
  fromExecTime?: int32(name='FromExecTime', description='The minimum execution duration of the task. This parameter is used to filter tasks whose execution duration is longer than the minimum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.', example='0'),
  fromStartTime?: string(name='FromStartTime', description='The start time of the O\\\\&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

This parameter is required.', example='2023-03-15T03:41:26Z'),
  instanceId?: string(name='InstanceId', description='The instance ID. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs. This parameter is empty by default, which indicates that tasks of all instances are queried.', example='dds-8vb38f0e7933xxxx'),
  instanceType?: string(name='InstanceType', description='The instance type of the instance. Set the value to Instance.', example='Instance'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be a positive integer. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 10 to 100. Default value: 10.', example='10'),
  regionId?: string(name='RegionId', description='The region ID of the pending event. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-beijing'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-aek2inrfrnw3xby'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task status. Valid values:

*   Scheduled: The task is waiting to be executed.
*   Running: The task is running.
*   Succeed: The task is successful.
*   Failed: The task failed.
*   Cancelling: The task is being terminated.
*   Canceled: The task has been terminated.
*   Waiting: The task is waiting for scheduled time.

Separate multiple states with commas (,). This parameter is empty by default, which indicates that tasks in all states are queried.', example='Succeed,Running,Waiting'),
  taskId?: string(name='TaskId', description='The task ID. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs. This parameter is empty by default, which indicates that all tasks are queried.', example='t-0mq1yyhm3ffl2bxxxx'),
  taskType?: string(name='TaskType', description='The task type. This parameter is left empty by default, which indicates that all types of tasks are queried. Valid values:

*   CreateIns: Create an instance.
*   DeleteIns: Delete an instance.
*   ChangeVariable: Modify parameter settings for an instance.
*   ModifyInsConfig: Change the configurations of an instance.
*   RestartIns: Restart an instance.
*   HaSwitch: Perform a primary/secondary switchover on an instance.
*   CloneIns: Clone an instance.
*   KernelVersionUpgrade: Update the minor version of an instance.
*   ProxyVersionUpgrade: Upgrade the agent version of an instance.
*   ModifyAccount: Change the account of an instance.
*   ModifyInsSpec: Change the specifications of an instance or perform a data migration on the instance.
*   CreateReadIns: Create a read-only instance.
*   StartIns: Start an instance.
*   StopIns: Stop an instance.
*   ModifyNetwork: Modify the network type for an instance.
*   LockIns: Lock an instance.
*   UnlockIns: Unlock an instance.
*   DiskOnlineExpansion: Scale out the disks of an instance online.
*   StorageOnlineExpansion: Expend the storage capacity of an instance online.
*   AddInsNode: Add a node to an instance.
*   DeleteInsNode: Delete a node from an instance.
*   ManualBackupIns: Manually back up an instance.
*   ModifyInsStorageType: Modify the storage type for an instance.', example='DeleteInsNode'),
  toExecTime?: int32(name='ToExecTime', description='The maximum execution duration of the task. This parameter is used to filter tasks whose execution duration is shorter than or equal to the maximum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.', example='0'),
  toStartTime?: string(name='ToStartTime', description='The end time of the O\\\\&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

This parameter is required.', example='2023-03-16T07:21:31Z'),
}

model DescribeHistoryTasksResponseBody = {
  items?: [ 
    {
      actionInfo?: string(name='ActionInfo', description='A set of allowed actions that can be taken on the task. The system matches the current step name and status of the task to the available actions specified by ActionInfo. If no matching action is found, the current status of the task does not support any action. Example:

       "steps": [
        {
          "step_name": "exec_task", // The name of the step, which matches the value of CurrentStepName.
          "action_info": {    // The actions supported for this step.
            "Waiting": [      // The status, which matches the value of Status.
              "modifySwitchTime" // The action. Multiple actions are supported.
            ]
          }
        },
        {
          "step_name": "init_task", // The name of the step.
          "action_info": {    // The actions supported for this step.
            "Running": [      // The status.
              "cancel",       // The action.
              "pause"
            ]
          }
        }
      ]
    }

The system may support the following actions:

*   retry: makes another attempt.
*   cancel: makes a cancellation.
*   modifySwitchTime: changes the switching or restoration time.', example='`{\\\\"steps\\\\":[{\\\\"action_info\\\\":{\\\\"Waiting\\\\":[\\\\"modifySwitchTime\\\\"]},\\\\"step_name\\\\":\\\\"exec_task\\\\"}]}`'),
      callerSource?: string(name='CallerSource', description='The request source. Valid values: System and User.', example='System'),
      callerUid?: string(name='CallerUid', description='The ID of the user who made the request. If CallerSource is set to User, CallerUid indicates the unique ID (UID) of the user.', example='141345906006****'),
      currentStepName?: string(name='CurrentStepName', description='The name of the current step. If this parameter is left empty, the task is not started.', example='exec_task'),
      dbType?: string(name='DbType', description='The database type. The value is fixed to mongodb.', example='mongodb'),
      endTime?: string(name='EndTime', description='The end time of the performed O\\\\&M task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-03-16T02:59Z'),
      instanceId?: string(name='InstanceId', description='The instance ID', example='dds-t4n18194768fxxxx'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='test-dds'),
      instanceType?: string(name='InstanceType', description='The instance type of the instance. The value is fixed to Instance.', example='Instance'),
      product?: string(name='Product', description='The product. The value is fixed to dds.', example='dds'),
      progress?: float(name='Progress', description='The current progress of the task. The valid values range from 0 to 100.', example='100.0'),
      reasonCode?: string(name='ReasonCode', description='The reason why the current task was initiated.', example='test'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      remainTime?: int32(name='RemainTime', description='The estimated remaining execution time. Unit: seconds. The value 0 indicates that the task is completed.', example='1000'),
      startTime?: string(name='StartTime', description='The start time of the performed O\\\\&M task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2023-02-11T02:33Z'),
      status?: string(name='Status', description='The task status. Valid values:

*   Scheduled: The task is waiting to be executed.
*   Running: The task is running.
*   Succeed: The task is successful.
*   Failed: The task failed.
*   Cancelling: The task is being terminated.
*   Canceled: The task has been terminated.
*   Waiting: The task is waiting for scheduled time.', example='Succeed'),
      taskDetail?: string(name='TaskDetail', description='The details of the task. The task details vary based on the value of the taskType parameter.', example='{\\\\"callerUid\\\\":\\\\"test\\\\"}'),
      taskId?: string(name='TaskId', description='The task ID.', example='t-0mq1yyhm3ffl2bxxxx'),
      taskType?: string(name='TaskType', description='The task type.

*   CreateIns: Create an instance.
*   DeleteIns: Delete an instance.
*   ChangeVariable: Modify parameter settings for an instance.
*   ModifyInsConfig: Change the configurations of an instance.
*   RestartIns: Restart an instance.
*   HaSwitch: Perform a primary/secondary switchover on an instance.
*   CloneIns: Clone an instance.
*   KernelVersionUpgrade: Update the minor version of an instance.
*   ProxyVersionUpgrade: Upgrade the agent version of an instance.
*   ModifyAccount: Change the account of an instance.
*   ModifyInsSpec: Change the specifications of an instance or perform a data migration on the instance.
*   CreateReadIns: Create a read-only instance.
*   StartIns: Start an instance.
*   StopIns: Stop an instance.
*   ModifyNetwork: Modify the network type for an instance.
*   LockIns: Lock an instance.
*   UnlockIns: Unlock an instance.
*   DiskOnlineExpansion: Scale out the disks of an instance online.
*   StorageOnlineExpansion: Expend the storage capacity of an instance online.
*   AddInsNode: Add a node to an instance.
*   DeleteInsNode: Delete a node from an instance.
*   ManualBackupIns: Manually back up an instance.
*   ModifyInsStorageType: Modify the storage type for an instance.', example='CreateIns'),
      uid?: string(name='Uid', description='The ID of the user to which the resource belongs.', example='141345906006****'),
    }
  ](name='Items', description='The task objects.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The maximum number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='3C4A2494-XXXX-XXXX-93CF-548DB3375193'),
  totalCount?: int32(name='TotalCount', description='The total number of tasks that meet these conditions without taking pagination into account.', example='5'),
}

model DescribeHistoryTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHistoryTasksResponseBody(name='body'),
}

/**
 * @summary Queries a list of tasks in the task center.
 *
 * @param request DescribeHistoryTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHistoryTasksResponse
 */
async function describeHistoryTasksWithOptions(request: DescribeHistoryTasksRequest, runtime: Util.RuntimeOptions): DescribeHistoryTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fromExecTime)) {
    query['FromExecTime'] = request.fromExecTime;
  }
  if (!Util.isUnset(request.fromStartTime)) {
    query['FromStartTime'] = request.fromStartTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.toExecTime)) {
    query['ToExecTime'] = request.toExecTime;
  }
  if (!Util.isUnset(request.toStartTime)) {
    query['ToStartTime'] = request.toStartTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHistoryTasks',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries a list of tasks in the task center.
 *
 * @param request DescribeHistoryTasksRequest
 * @return DescribeHistoryTasksResponse
 */
async function describeHistoryTasks(request: DescribeHistoryTasksRequest): DescribeHistoryTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHistoryTasksWithOptions(request, runtime);
}

model DescribeHistoryTasksStatRequest {
  fromExecTime?: int32(name='FromExecTime', description='The minimum execution duration of the task. This parameter is used to filter tasks whose execution duration is longer than the minimum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.', example='0'),
  fromStartTime?: string(name='FromStartTime', description='The start time of the O\\\\&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

This parameter is required.', example='2023-04-16T02:46:21Z'),
  instanceId?: string(name='InstanceId', description='The instance ID. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs. This parameter is empty by default, which indicates that the tasks of all instances are queried.', example='dds-8vb38f0e7933xxxx'),
  regionId?: string(name='RegionId', description='The region ID of the pending event. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The task status. Valid values:

*   Scheduled: The task is waiting to be executed.
*   Running: The task is running.
*   Succeed: The task is successful.
*   Failed: The task failed.
*   Cancelling: The task is being terminated.
*   Canceled: The task has been terminated.
*   Waiting: The task is waiting for scheduled time.

Separate multiple states with commas (,). This parameter is empty by default, which indicates that tasks in all states are queried.', example='Succeed'),
  taskId?: string(name='TaskId', description='The task ID. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs. This parameter is empty by default, which indicates that all tasks are queried.', example='t-0mq1yyhm3ffl2bxxxx'),
  taskType?: string(name='TaskType', description='The task type. This parameter is left empty by default, which indicates that all types of tasks are queried. Valid values:

*   CreateIns: Create an instance.
*   DeleteIns: Delete an instance.
*   ChangeVariable: Modify parameter settings for an instance.
*   ModifyInsConfig: Change the configurations of an instance.
*   RestartIns: Restart an instance.
*   HaSwitch: Perform a primary/secondary switchover on an instance.
*   CloneIns: Clone an instance.
*   KernelVersionUpgrade: Update the minor version of an instance.
*   ProxyVersionUpgrade: Upgrade the agent version of an instance.
*   ModifyAccount: Change the account of an instance.
*   ModifyInsSpec: Change the specifications of an instance or perform a data migration on the instance.
*   CreateReadIns: Create a read-only instance.
*   StartIns: Start an instance.
*   StopIns: Stop an instance.
*   ModifyNetwork: Modify the network type for an instance.
*   LockIns: Lock an instance.
*   UnlockIns: Unlock an instance.
*   DiskOnlineExpansion: Scale out the disks of an instance online.
*   StorageOnlineExpansion: Expend the storage capacity of an instance online.
*   AddInsNode: Add a node to an instance.
*   DeleteInsNode: Delete a node from an instance.
*   ManualBackupIns: Manually back up an instance.
*   ModifyInsStorageType: Modify the storage type for an instance.', example='DeleteIns'),
  toExecTime?: int32(name='ToExecTime', description='The maximum execution duration of the task. This parameter is used to filter tasks whose execution duration is shorter than or equal to the maximum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.', example='0'),
  toStartTime?: string(name='ToStartTime', description='The end time of the O\\\\&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

This parameter is required.', example='2023-05-16T02:15:52Z'),
}

model DescribeHistoryTasksStatResponseBody = {
  items?: [ 
    {
      status?: string(name='Status', description='The task status. Valid values:

*   Scheduled: The task is waiting to be executed.
*   Running: The task is running.
*   Succeed: The task is successful.
*   Failed: The task failed.
*   Cancelling: The task is being terminated.
*   Canceled: The task has been terminated.
*   Waiting: The task is waiting for scheduled time.', example='Succeed'),
      totalCount?: int32(name='TotalCount', description='The number of tasks in a specified state.', example='2'),
    }
  ](name='Items', description='The task objects.'),
  requestId?: string(name='RequestId', description='The request ID.', example='FC724D23-XXXX-XXXX-ABB1-606C935AE7FD'),
}

model DescribeHistoryTasksStatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHistoryTasksStatResponseBody(name='body'),
}

/**
 * @summary Queries the overview of a task in the task center.
 *
 * @param request DescribeHistoryTasksStatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHistoryTasksStatResponse
 */
async function describeHistoryTasksStatWithOptions(request: DescribeHistoryTasksStatRequest, runtime: Util.RuntimeOptions): DescribeHistoryTasksStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fromExecTime)) {
    query['FromExecTime'] = request.fromExecTime;
  }
  if (!Util.isUnset(request.fromStartTime)) {
    query['FromStartTime'] = request.fromStartTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.toExecTime)) {
    query['ToExecTime'] = request.toExecTime;
  }
  if (!Util.isUnset(request.toStartTime)) {
    query['ToStartTime'] = request.toStartTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHistoryTasksStat',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the overview of a task in the task center.
 *
 * @param request DescribeHistoryTasksStatRequest
 * @return DescribeHistoryTasksStatResponse
 */
async function describeHistoryTasksStat(request: DescribeHistoryTasksStatRequest): DescribeHistoryTasksStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHistoryTasksStatWithOptions(request, runtime);
}

model DescribeInstanceAutoRenewalAttributeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.', example='dds-bp567b****'),
  DBInstanceType?: string(name='DBInstanceType', description='The category of the instance. Valid values:

*   **replicate**: the standalone or replica set instance
*   **sharding**: the sharded cluster instance

Default value: **replicate**.', example='replicate'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: long(name='PageNumber', description='The number of the page to return. The value must be a positive integer that does not exceed the maximum value of the Integer parameter. Default value: **1**.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**.

>  Default value: **30**.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeInstanceAutoRenewalAttributeResponseBody = {
  items?: {
    item?: [ 
    {
      autoRenew?: string(name='AutoRenew', description='Indicates whether auto-renewal is enabled for the instance. Valid values:

*   **true**: Auto-renewal is enabled for the instance.
*   **false**: Auto-renewal is disabled for the instance.', example='true'),
      DBInstanceType?: string(name='DBInstanceType', description='The category of the instance. Valid values:

*   **replicate**: the standalone or replica set instance
*   **sharding**: the sharded cluster instance', example='replicate'),
      dbInstanceId?: string(name='DbInstanceId', description='The ID of the instance.', example='dds-bp2568*****'),
      duration?: string(name='Duration', description='The auto-renewal period. Unit: months.

> * This parameter is ruturned only when the returned value of the **AutoRenew** parameter is **true**.
> * You can call the [ModifyInstanceAutoRenewalAttribute](https://help.aliyun.com/document_detail/145979.html) operation to modify the auto-renewal period.', example='1'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
    }
  ](name='Item')
  }(name='Items', description='Details about returned entries.'),
  itemsNumbers?: int32(name='ItemsNumbers', description='The total number of entries returned.', example='2'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries that were returned on the current page.', example='2'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FAB5CB3B-DB9D-473A-9DF1-F57B6B9CB949'),
}

model DescribeInstanceAutoRenewalAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceAutoRenewalAttributeResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query whether auto-renewal is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to subscription instances.
 *
 * @param request DescribeInstanceAutoRenewalAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceAutoRenewalAttributeResponse
 */
async function describeInstanceAutoRenewalAttributeWithOptions(request: DescribeInstanceAutoRenewalAttributeRequest, runtime: Util.RuntimeOptions): DescribeInstanceAutoRenewalAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBInstanceType)) {
    query['DBInstanceType'] = request.DBInstanceType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceAutoRenewalAttribute',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query whether auto-renewal is enabled for an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to subscription instances.
 *
 * @param request DescribeInstanceAutoRenewalAttributeRequest
 * @return DescribeInstanceAutoRenewalAttributeResponse
 */
async function describeInstanceAutoRenewalAttribute(request: DescribeInstanceAutoRenewalAttributeRequest): DescribeInstanceAutoRenewalAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceAutoRenewalAttributeWithOptions(request, runtime);
}

model DescribeInstanceRecoverTimeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeInstanceRecoverTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='F8CA8312-530A-413A-9129-F2BB32A8D404'),
  restoreRanges?: [ 
    {
      restoreBeginTime?: string(name='RestoreBeginTime', description='The beginning of the time range to which data can be restored.', example='2023-10-16T19:33:20Z'),
      restoreEndTime?: string(name='RestoreEndTime', description='The end of the time range to which data can be restored.', example='2023-10-16T19:43:20Z'),
      restoreType?: string(name='RestoreType', description='The method used to restore data. Valid value:

*   PointInTime (default): Data is restored to a point in time.', example='PointInTime'),
    }
  ](name='RestoreRanges', description='The time ranges to which data can be restored. The time ranges include those used for point-in-time data restoration.'),
}

model DescribeInstanceRecoverTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInstanceRecoverTimeResponseBody(name='body'),
}

/**
 * @summary Queries the time required to restore the data of an ApsaraDB for MongoDB replica set instance that uses cloud disks.
 *
 * @param request DescribeInstanceRecoverTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInstanceRecoverTimeResponse
 */
async function describeInstanceRecoverTimeWithOptions(request: DescribeInstanceRecoverTimeRequest, runtime: Util.RuntimeOptions): DescribeInstanceRecoverTimeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInstanceRecoverTime',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the time required to restore the data of an ApsaraDB for MongoDB replica set instance that uses cloud disks.
 *
 * @param request DescribeInstanceRecoverTimeRequest
 * @return DescribeInstanceRecoverTimeResponse
 */
async function describeInstanceRecoverTime(request: DescribeInstanceRecoverTimeRequest): DescribeInstanceRecoverTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceRecoverTimeWithOptions(request, runtime);
}

model DescribeKernelReleaseNotesRequest {
  kernelVersion?: string(name='KernelVersion', description='The minor version number of the instance. Example: **mongodb_20180522_0.4.8**.

*   This parameter is required. After you specify a version number for this parameter in a request, the release notes of the versions later than this version are returned.', example='mongodb_20180522_0.4.8'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeKernelReleaseNotesResponseBody = {
  releaseNotes?: {
    releaseNote?: [ 
    {
      kernelVersion?: string(name='KernelVersion', description='The version number.', example='mongodb_20180619_0.4.9'),
      releaseNote?: string(name='ReleaseNote', description='The release notes.', example='test release note.'),
    }
  ](name='ReleaseNote')
  }(name='ReleaseNotes', description='The list of the version release notes.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F01D4DDA-CB72-4083-B399-AF4642294FE6'),
}

model DescribeKernelReleaseNotesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKernelReleaseNotesResponseBody(name='body'),
}

/**
 * @summary Queries the release notes of the minor versions of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeKernelReleaseNotesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKernelReleaseNotesResponse
 */
async function describeKernelReleaseNotesWithOptions(request: DescribeKernelReleaseNotesRequest, runtime: Util.RuntimeOptions): DescribeKernelReleaseNotesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.kernelVersion)) {
    query['KernelVersion'] = request.kernelVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKernelReleaseNotes',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the release notes of the minor versions of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeKernelReleaseNotesRequest
 * @return DescribeKernelReleaseNotesResponse
 */
async function describeKernelReleaseNotes(request: DescribeKernelReleaseNotesRequest): DescribeKernelReleaseNotesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKernelReleaseNotesWithOptions(request, runtime);
}

model DescribeKmsKeysRequest {
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId', description='The region ID. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeKmsKeysResponseBody = {
  kmsKeys?: [ 
    {
      keyAlias?: string(name='KeyAlias', description='The alias of the key.', example='key-shh656820f4mh9qxxxxx     alias/test1'),
      keyId?: string(name='KeyId', description='The key ID.', example='37291352-xxxx-xxxx-adbf-fd0630a95583'),
    }
  ](name='KmsKeys', description='The KMS keys.'),
  requestId?: string(name='RequestId', description='The request ID.', example='60EEBD77-227C-5B39-86EA-D89163C5****'),
}

model DescribeKmsKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKmsKeysResponseBody(name='body'),
}

/**
 * @summary Queries Key Management Service (KMS) keys that are available for disk encryption.
 *
 * @description Queried keys are available only for disk encryption.
 *
 * @param request DescribeKmsKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKmsKeysResponse
 */
async function describeKmsKeysWithOptions(request: DescribeKmsKeysRequest, runtime: Util.RuntimeOptions): DescribeKmsKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKmsKeys',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries Key Management Service (KMS) keys that are available for disk encryption.
 *
 * @description Queried keys are available only for disk encryption.
 *
 * @param request DescribeKmsKeysRequest
 * @return DescribeKmsKeysResponse
 */
async function describeKmsKeys(request: DescribeKmsKeysRequest): DescribeKmsKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKmsKeysWithOptions(request, runtime);
}

model DescribeMongoDBLogConfigRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID. You can call the [DescribeDBInstances](https://help.aliyun.com/document_detail/61939.html) operation to query the ID of the instance.

This parameter is required.', example='dds-bp12c5b040dc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeMongoDBLogConfigResponseBody = {
  enableAudit?: boolean(name='EnableAudit', description='Indicates whether to enable the audit log feature.

*   **true**: The audit log feature is enabled.
*   **false**: The audit log feature is disabled.', example='true'),
  isEtlMetaExist?: int32(name='IsEtlMetaExist', description='Indicates whether a rule to distribute logs to Logtail is created. For more information, see [Logtail overview](https://help.aliyun.com/document_detail/28979.html). Valid values:

*   **1**: A rule to distribute logs to Logtail is created.
*   **0** or **null**: A rule to distribute logs to Logtail is not created.', example='1'),
  isUserProjectLogstoreExist?: int32(name='IsUserProjectLogstoreExist', description='Indicates whether a project exists in the current region. Valid values:

*   **1**: A logging project exists in the current region.
*   **0** or **null**: A logging project does not exist in the current region.', example='1'),
  preserveStorageForStandard?: long(name='PreserveStorageForStandard', description='The maximum storage capacity for the formal edition of the audit log feature. If the value is -1, no maximum storage capacity is set.', example='-1'),
  preserveStorageForTrail?: long(name='PreserveStorageForTrail', description='The maximum storage capacity for the free trial edition of the audit log feature. Unit: bytes. You can set the maximum storage capacity to 107,374,182,400 bytes.', example='107374182400'),
  requestId?: string(name='RequestId', description='The request ID.', example='664ECE26-658A-47C5-88F6-870B0132E8D2'),
  serviceType?: string(name='ServiceType', description='The type of the audit log feature. Valid values:

*   **Trail**: the free trial edition
*   **Standard**: the official edition', example='Standard'),
  ttlForStandard?: long(name='TtlForStandard', description='The retention period for the official edition of the audit log feature. Valid values: 1 to 365. Unit: day.', example='30'),
  ttlForTrail?: long(name='TtlForTrail', description='The retention period for the free trial edition of the audit log feature.', example='1'),
  usedStorageForStandard?: long(name='UsedStorageForStandard', description='The used storage capacity for the formal edition of the audit log feature. Unit: bytes.', example='20163'),
  usedStorageForTrail?: long(name='UsedStorageForTrail', description='The used storage capacity for the free trial edition of the audit log feature. Unit: bytes.', example='12548178759'),
  userProjectName?: string(name='UserProjectName', description='The name of the project.', example='nosql-176498472570****-cn-hangzhou'),
}

model DescribeMongoDBLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMongoDBLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries the logging configurations of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * This operation depends on the audit log feature of ApsaraDB for MongoDB. You can enable the audit log feature based on your business requirements. For more information, see [Enable the audit log feature](https://help.aliyun.com/document_detail/59903.html).
 * *   Starting from January 6, 2022, the official edition of the audit log feature has been launched in all regions, and new applications for the free trial edition have ended. For more information, see [Notice on official launch of the pay-as-you-go audit log feature and no more application for the free trial edition](https://help.aliyun.com/document_detail/377480.html)
 * *   You are charged for the official edition of the audit log feature based on the storage capacity that is consumed by audit logs and the retention period of the audit logs. For more information, see [Pricing of ApsaraDB for MongoDB instances](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 *
 * @param request DescribeMongoDBLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMongoDBLogConfigResponse
 */
async function describeMongoDBLogConfigWithOptions(request: DescribeMongoDBLogConfigRequest, runtime: Util.RuntimeOptions): DescribeMongoDBLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMongoDBLogConfig',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the logging configurations of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * This operation depends on the audit log feature of ApsaraDB for MongoDB. You can enable the audit log feature based on your business requirements. For more information, see [Enable the audit log feature](https://help.aliyun.com/document_detail/59903.html).
 * *   Starting from January 6, 2022, the official edition of the audit log feature has been launched in all regions, and new applications for the free trial edition have ended. For more information, see [Notice on official launch of the pay-as-you-go audit log feature and no more application for the free trial edition](https://help.aliyun.com/document_detail/377480.html)
 * *   You are charged for the official edition of the audit log feature based on the storage capacity that is consumed by audit logs and the retention period of the audit logs. For more information, see [Pricing of ApsaraDB for MongoDB instances](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 *
 * @param request DescribeMongoDBLogConfigRequest
 * @return DescribeMongoDBLogConfigResponse
 */
async function describeMongoDBLogConfig(request: DescribeMongoDBLogConfigRequest): DescribeMongoDBLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMongoDBLogConfigWithOptions(request, runtime);
}

model DescribeParameterModificationHistoryRequest {
  characterType?: string(name='CharacterType', description='The role of the instance. Valid values:

*   **db**: shard
*   **cs**: Configserver
*   **mongos**: mongos
*   **logic**: sharded cluster instance', example='mongos'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp2235****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC. The end time must be later than the start time.

This parameter is required.', example='2019-01-02T12:10:10Z'),
  nodeId?: string(name='NodeId', description='The ID of the mongos node or shard node whose parameter modification records you want to query in the instance.

>  This parameter is valid only when **DBInstanceId** is set to the ID of a sharded cluster instance.', example='d-bp1158****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-01-01T12:10:10Z'),
}

model DescribeParameterModificationHistoryResponseBody = {
  historicalParameters?: {
    historicalParameter?: [ 
    {
      modifyTime?: string(name='ModifyTime', description='The time when the parameter was modified. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-03-12T07:58:24Z'),
      newParameterValue?: string(name='NewParameterValue', description='The parameter value after modification.', example='200'),
      oldParameterValue?: string(name='OldParameterValue', description='The parameter value before modification.', example='100'),
      parameterName?: string(name='ParameterName', description='The name of the modified parameter.', example='operationProfiling.slowOpThresholdMs'),
    }
  ](name='HistoricalParameter')
  }(name='HistoricalParameters', description='Details about the parameter modification records.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B1BB6E0E-B4EF-4145-81FA-A07719860248'),
}

model DescribeParameterModificationHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterModificationHistoryResponseBody(name='body'),
}

/**
 * @summary Queries the parameter modification records of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeParameterModificationHistoryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterModificationHistoryResponse
 */
async function describeParameterModificationHistoryWithOptions(request: DescribeParameterModificationHistoryRequest, runtime: Util.RuntimeOptions): DescribeParameterModificationHistoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeParameterModificationHistory',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the parameter modification records of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeParameterModificationHistoryRequest
 * @return DescribeParameterModificationHistoryResponse
 */
async function describeParameterModificationHistory(request: DescribeParameterModificationHistoryRequest): DescribeParameterModificationHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParameterModificationHistoryWithOptions(request, runtime);
}

model DescribeParameterTemplatesRequest {
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.

This parameter is required.', example='mongodb'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values:

*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**

This parameter is required.', example='5.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  role?: string(name='Role', description='The role of the instance. Valid values:

1. db:  a shard node.

1. cs:  a Configserver node.

1. mongos:  a mongos node.

1. normal: a replica set node.

1. physical: a standalone node.

default: normal', example='normal'),
}

model DescribeParameterTemplatesResponseBody = {
  engine?: string(name='Engine', description='The database engine of the instance.', example='mongodb'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='5.0'),
  parameterCount?: string(name='ParameterCount', description='The number of parameters that are supported by the instance.', example='10'),
  parameters?: {
    templateRecord?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The value range of modifiable parameters.', example='[0-65536]'),
      forceModify?: boolean(name='ForceModify', description='Indicates whether the parameter is modifiable.

*   **false**: The parameter cannot be modified.
*   **true**: The parameter can be modified.', example='true'),
      forceRestart?: boolean(name='ForceRestart', description='Indicates whether a restart is required for parameter modifications to take effect.

*   **false**: A restart is not required. Parameter modifications immediately take effect.
*   **true**: A restart is required for parameter modifications to take effect.', example='false'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='The threshold in milliseconds at which the database profiler considers a query slow, default is 100.'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='net.compression.compressors'),
      parameterValue?: string(name='ParameterValue', description='The default value of the parameter.', example='100'),
    }
  ](name='TemplateRecord')
  }(name='Parameters', description='Details about the parameter templates.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='BDA54203-9D61-54A3-A568-D281F785****'),
}

model DescribeParameterTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParameterTemplatesResponseBody(name='body'),
}

/**
 * @summary Queries the list of default parameter templates for ApsaraDB for MongoDB instances.
 *
 * @param request DescribeParameterTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplatesWithOptions(request: DescribeParameterTemplatesRequest, runtime: Util.RuntimeOptions): DescribeParameterTemplatesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.role)) {
    query['Role'] = request.role;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeParameterTemplates',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the list of default parameter templates for ApsaraDB for MongoDB instances.
 *
 * @param request DescribeParameterTemplatesRequest
 * @return DescribeParameterTemplatesResponse
 */
async function describeParameterTemplates(request: DescribeParameterTemplatesRequest): DescribeParameterTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParameterTemplatesWithOptions(request, runtime);
}

model DescribeParametersRequest {
  characterType?: string(name='CharacterType', description='The role of the instance. Valid values:

*   db: a shard node.
*   cs: a Configserver node.
*   mongos: a mongos node.', example='mongos'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bpxxxxxxxx'),
  extraParam?: string(name='ExtraParam', description='The parameter that is available in the future.', example='terrform'),
  nodeId?: string(name='NodeId', description='The ID of the mongos or shard node in the specified sharded cluster instance.

>  This parameter is valid when the **DBInstanceId** parameter is set to the ID of a sharded cluster instance.', example='d-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeParametersResponseBody = {
  configParameters?: {
    parameter?: [ 
    {
      checkingCode?: string(name='CheckingCode', description='The valid values of the parameter.', example='[0-65536]'),
      forceRestart?: boolean(name='ForceRestart', description='Indicates whether a restart is required for parameter modifications to take effect. Valid values:

*   **false**: A restart is not required. Modifications take effect immediately.
*   **true**: A restart is required for parameter modifications to take effect.', example='true'),
      modifiableStatus?: boolean(name='ModifiableStatus', description='Indicates whether the parameter value can be modified. Valid values:

*   **false**: The parameter value cannot be modified.
*   **true**: The parameter value can be modified.', example='true'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='The threshold in milliseconds at which the database profiler considers a query slow, default is 100.'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='operationProfiling.slowOpThresholdMs'),
      parameterValue?: string(name='ParameterValue', description='The value of the parameter.', example='200'),
    }
  ](name='Parameter')
  }(name='ConfigParameters', description='The parameter settings in the configuration template.'),
  engine?: string(name='Engine', description='The database engine of the instance. Default value: **mongodb**.', example='mongodb'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='4.0'),
  requestId?: string(name='RequestId', description='The request ID.', example='3ADD0C7D-2D2A-4F15-88FF-E7AC9B9FDCC8'),
  runningParameters?: {
    parameter?: [ 
    {
      characterType?: string(name='CharacterType', description='实例的角色类型，取值说明：

- **db**：shard角色。
- **cs**：config server角色。
- **mongos**：mongos角色。', example='db'),
      checkingCode?: string(name='CheckingCode', description='The valid values of the parameter.', example='[33554432-268435456]'),
      forceRestart?: string(name='ForceRestart', description='Indicates whether a restart is required for parameter modifications to take effect. Valid values:

*   **false**: A restart is not required. Modifications take effect immediately.
*   **true**: A restart is required for parameter modifications to take effect.', example='false'),
      modifiableStatus?: string(name='ModifiableStatus', description='Indicates whether the parameter value can be modified. Valid values:

*   **false**: The parameter value cannot be modified.
*   **true**: The parameter value can be modified.', example='true'),
      parameterDescription?: string(name='ParameterDescription', description='The description of the parameter.', example='The maximum memory bytes that sort stage may use, default is 33554432(i.e. 32MB)'),
      parameterName?: string(name='ParameterName', description='The name of the parameter.', example='setParameter.internalQueryExecMaxBlockingSortBytes'),
      parameterValue?: string(name='ParameterValue', description='The value of the parameter.', example='33554432'),
    }
  ](name='Parameter')
  }(name='RunningParameters', description='The settings of the parameters that have taken effect.'),
}

model DescribeParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeParametersResponseBody(name='body'),
}

/**
 * @summary Queries the parameter settings of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeParametersResponse
 */
async function describeParametersWithOptions(request: DescribeParametersRequest, runtime: Util.RuntimeOptions): DescribeParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.extraParam)) {
    query['ExtraParam'] = request.extraParam;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeParameters',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the parameter settings of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeParametersRequest
 * @return DescribeParametersResponse
 */
async function describeParameters(request: DescribeParametersRequest): DescribeParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParametersWithOptions(request, runtime);
}

model DescribePriceRequest {
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{"AccountPassword":"Pw123456","DBInstanceDescription":"test"}'),
  commodityCode?: string(name='CommodityCode', description='The code of the instance. Valid values:

*   **dds**: a replica set instance that uses the pay-as-you-go billing method
*   **badds**: a replica set instance that uses the subscription billing method
*   **dds_sharding**: a sharded cluster instance that uses the pay-as-you-go billing method
*   **badds_sharding**: a sharded cluster instance that uses the subscription billing method
*   **badds_sharding_intl**: a sharded cluster instance that uses the subscription billing method and is available on the International site (alibabacloud.com)
*   **dds_sharding_intl**: a sharded cluster instance that uses the pay-as-you-go billing method and is available on the International site (alibabacloud.com)
*   **badds_sharding_jp**: a sharded cluster instance that uses the subscription billing method and is available on the Japan site (jp.alibabacloud.com)
*   **badds_intl**: a replica set instance that uses the subscription billing method and is available on the International site (alibabacloud.com)
*   **dds_intl**: a replica set instance that uses the pay-as-you-go billing method and is available on the International site (alibabacloud.com)', example='badds'),
  couponNo?: string(name='CouponNo', description='Specifies whether to use coupons. Default value: null. Valid values:

*   **default** or **null**: uses coupons.
*   **youhuiquan_promotion_option_id_for_blank**: does not use coupons.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstances?: string(name='DBInstances', description='A JSON string that contains the details of the instance. For more information about the parameter and sample JSON formats, see [DescribePrice](https://help.aliyun.com/document_detail/197291.html).

This parameter is required.', example='[ { "DBInstanceId":"dds-bp1b6e54e7cc****", "RegionId":"cn-hangzhou", "ZoneId":"cn-hangzhou-h", "Engine":"MongoDB", "EngineVersion":" 5.0", "DBInstanceClass":"mdb.shard.2x.xlarge.d", "DBInstanceStorage":30, "ChargeType":"PrePaid", "Period":1, "StorageType":"cloud_essd1" } ]'),
  orderParamOut?: string(name='OrderParamOut', description='Specifies whether to return the OrderParams parameter. Valid values:

*   **false** (default)
*   **true**', example='true'),
  orderType?: string(name='OrderType', description='The order type. Valid values:

*   **BUY**
*   **UPGRADE**
*   **RENEW**

This parameter is required.', example='BUY'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  productCode?: string(name='ProductCode', description='The code of the service. Default value: **dds**.', example='dds'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribePriceResponseBody = {
  order?: {
    code?: string(name='Code', description='The order code.', example='""'),
    contractActivity?: boolean(name='ContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
    coupons?: {
      coupon?: [ 
      {
        activityCategory?: string(name='ActivityCategory', description='The activity type of the coupon. Valid values:

*   **payondemand**: subscription
*   **payasyougo**: pay-as-you-go', example='payondemand'),
        couponNo?: string(name='CouponNo', description='The coupon ID.', example='youhuiquan_promotion_option_id_for_blank'),
        description?: string(name='Description', description='The description of the coupon.', example='ceshi'),
        isSelected?: string(name='IsSelected', description='Indicates whether the coupon was selected. Valid values:

*   **true**
*   **false**', example='true'),
        name?: string(name='Name', description='The coupon name.', example='youhuiquan111'),
        optionCode?: string(name='OptionCode', description='The code of the coupon.', example='youhui_quan'),
        promotionOptionCode?: string(name='PromotionOptionCode', description='The promotional option code.', example='youhui_quan'),
        promotionRuleIdList?: {
          promotionRuleId?: [ long ](name='PromotionRuleId')
        }(name='PromotionRuleIdList', description='The IDs of the rules that correspond to the coupon.'),
      }
    ](name='Coupon')
    }(name='Coupons', description='The information of coupons.'),
    currency?: string(name='Currency', description='The currency.', example='USD'),
    depreciateInfo?: {
      cheapRate?: double(name='CheapRate', description='The price reduction rate.', example='30%'),
      cheapStandAmount?: double(name='CheapStandAmount', description='The new total price displayed on the official website.', example='9*'),
      contractActivity?: {
        activityId?: long(name='ActivityId', description='The activity ID.', example='41120065996xxxxx'),
        activityName?: string(name='ActivityName', description='The activity name.', example='contract promotion_order_xxx discount'),
        finalFee?: double(name='FinalFee', description='The price after the promotion.', example='20522.4'),
        finalPromFee?: double(name='FinalPromFee', description='The total discount amount.', example='3621.6'),
        optionCode?: string(name='OptionCode', description='The promotion ID.', example='wanhua_activity'),
        optionIds?: {
          optionId?: [ long ](name='OptionId')
        }(name='OptionIds', description='The promotion IDs.'),
        prodFee?: double(name='ProdFee', description='The original price.', example='24144.0'),
      }(name='ContractActivity', description='The contract promotion.'),
      differential?: double(name='Differential', description='The price difference displayed in the total order amount.', example='**'),
      differentialName?: string(name='DifferentialName', description='The name of the price difference.', example='XXXXX'),
      isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
      isShow?: string(name='IsShow', description='Indicates whether the price reduction rate is displayed.', example='true'),
      listPrice?: double(name='ListPrice', description='The list price.', example='1*'),
      monthPrice?: double(name='MonthPrice', description='The monthly price.', example='**'),
      originalStandAmount?: double(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='12*'),
    }(name='DepreciateInfo', description='The price reduction information.'),
    discountAmount?: string(name='DiscountAmount', description='The discount amount of the order.', example='322.4'),
    isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
    message?: string(name='Message', description='The order information.', example='""'),
    optionalPromotions?: string(name='OptionalPromotions', description='The promotional activity information.', example='[{\\\\”activityCategory\\\\”:\\\\”discount\\\\”,\\\\”activityExtInfo\\\\”:{\\\\”noUseYouhuiquan\\\\”:\\\\”true\\\\”,\\\\”activityId\\\\”:\\\\”191156098xxxx\\\\”,\\\\”activityExtraAttr\\\\”:\\\\”{\\\\\\\\\\\\\\\\”forbiddenCpsProfit\\\\\\\\\\\\\\\\”:\\\\\\\\\\\\\\\\”true\\\\\\\\\\\\\\\\”,\\\\\\\\\\\\\\\\”forbiddenCouponsRestricted\\\\\\\\\\\\\\\\”:\\\\\\\\\\\\\\\\”true\\\\\\\\\\\\\\\\”,\\\\\\\\\\\\\\\\”forbiddenAmbassadorProfit\\\\\\\\\\\\\\\\”:\\\\\\\\\\\\\\\\”true\\\\\\\\\\\\\\\\”}\\\\”,\\\\”isActivityIdFromWanHuaTong\\\\”:\\\\”true\\\\”,\\\\”isContractActivity\\\\”:\\\\”false\\\\”},\\\\”canPromFee\\\\”:906130,\\\\”optionCode\\\\”:\\\\”wanhua_activity\\\\”,\\\\”promotionName\\\\”:\\\\”FY24--MongoDB replica set - first-time purchase - \\\\* discount for a one-year period - first-time purchase benefits\\\\”,\\\\”promotionOptionNo\\\\”:\\\\”19115609882xxxx\\\\”,\\\\”promotionRuleIdList\\\\”:[2091xxxx],\\\\”selected\\\\”:true,\\\\”targetArticleItemCodes\\\\”:[]},{\\\\”activityCategory\\\\”:\\\\”discount\\\\”,\\\\”activityExtInfo\\\\”:{\\\\”activityId\\\\”:\\\\”1018040010xxxxx\\\\”,\\\\”wanHuaOrderExpireSec\\\\”:\\\\”604800\\\\”,\\\\”isActivityIdFromWanHuaTong\\\\”:\\\\”true\\\\”,\\\\”isContractActivity\\\\”:\\\\”false\\\\”},\\\\”canPromFee\\\\”:339799,\\\\”optionCode\\\\”:\\\\”wanhua_activity\\\\”,\\\\”promotionName\\\\”:\\\\”FY24--MongoDB discount for a one-year period \\\\”,\\\\”promotionOptionNo\\\\”:\\\\”10180400107xxxxx\\\\”,\\\\”promotionRuleIdList\\\\”:[xxxxx],\\\\”selected\\\\”:false,\\\\”targetArticleItemCodes\\\\”:[]}]”'),
    originalAmount?: string(name='OriginalAmount', description='The original price of the order.', example='322.4'),
    promDetailList?: string(name='PromDetailList', description='The promotional activity that is hit.', example='[{\\\\”finalPromFee\\\\”:90xxx,\\\\”optionCode\\\\”:\\\\”wanhua_activity\\\\”,\\\\”promType\\\\”:\\\\”discount\\\\”,\\\\”promotionId\\\\”:2091xxxx,\\\\”promotionName\\\\”:\\\\”\\\\* discount is provided for new users who purchase ApsaraDB for MongoDB replica set instances for one year. A new user can purchase an ApsaraDB for MongoDB replica set instance only by using the discount.\\\\”}]”'),
    ruleIds?: {
      ruleId?: [ string ](name='RuleId')
    }(name='RuleIds', description='The rules of the order.'),
    showDiscountInfo?: boolean(name='ShowDiscountInfo', description='Indicates whether the discount information is displayed.', example='true'),
    standDiscountPrice?: double(name='StandDiscountPrice', description='The discount.', example='0'),
    standPrice?: double(name='StandPrice', description='The discount.', example='0'),
    tradeAmount?: string(name='TradeAmount', description='The final price of the order.', example='0'),
  }(name='Order', description='The order information.'),
  orderParams?: string(name='OrderParams', description='The order parameters.

> This parameter is returned only when the **OrderParamOut** parameter is set to **true**.', example='{\\\\"autoPay\\\\":false}"'),
  requestId?: string(name='RequestId', description='The request ID.', example='27227A3D-6B86-56F3-9E03-9E60F001CE12'),
  rules?: {
    rule?: [ 
    {
      name?: string(name='Name', description='The rule name.', example='demoname'),
      ruleDescId?: long(name='RuleDescId', description='The rule ID.', example='2075****'),
      title?: string(name='Title', description='The rule title.', example='demo'),
    }
  ](name='Rule')
  }(name='Rules', description='The promotion rules.'),
  subOrders?: {
    subOrder?: [ 
    {
      contractActivity?: boolean(name='ContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
      depreciateInfo?: {
        cheapRate?: double(name='CheapRate', description='The price reduction rate.', example='30%'),
        cheapStandAmount?: double(name='CheapStandAmount', description='The new total price displayed on the official website.', example='9*'),
        contractActivity?: {
          activityId?: long(name='ActivityId', description='The activity ID.', example='41120065996xxxxx'),
          activityName?: string(name='ActivityName', description='The activity name.', example='contract promotion_order_xxx discount'),
          finalFee?: double(name='FinalFee', description='The price after the promotion.', example='20522.4'),
          finalPromFee?: double(name='FinalPromFee', description='The total discount amount.', example='3621.6'),
          optionCode?: string(name='OptionCode', description='The promotion ID.', example='wanhua_activity'),
          optionIds?: {
            optionId?: [ long ](name='OptionId')
          }(name='OptionIds', description='The promotion IDs.'),
          prodFee?: double(name='ProdFee', description='The original price.', example='24144.0'),
        }(name='ContractActivity', description='The activity information.'),
        differential?: double(name='Differential', description='The price difference displayed in the total order amount.', example='**'),
        differentialName?: string(name='DifferentialName', description='The name of the price difference.', example='XXXXX'),
        isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
        isShow?: string(name='IsShow', description='Indicates whether the price reduction rate is displayed.', example='true'),
        listPrice?: double(name='ListPrice', description='The list price.', example='1*'),
        monthPrice?: double(name='MonthPrice', description='The monthly price.', example='**'),
        originalStandAmount?: double(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='12*'),
        startTime?: string(name='StartTime', description='The start time of the activity.', example='2024-02-29 10:30:00'),
      }(name='DepreciateInfo', description='The price reduction information.'),
      discountAmount?: string(name='DiscountAmount', description='The discount amount of the order.', example='322.4'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='dds-bp1b6e54e7cc****'),
      isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
      isNewOfficialActivity?: string(name='IsNewOfficialActivity', description='Indicates whether the discount is hit.', example='true'),
      moduleInstance?: {
        moduleInstance?: [ 
        {
          contractActivity?: boolean(name='ContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
          cycleFee?: string(name='CycleFee', description='The cycle fee of the module.', example='0.0'),
          depreciateInfo?: {
            cheapRate?: double(name='CheapRate', description='The price reduction rate.', example='30%'),
            cheapStandAmount?: double(name='CheapStandAmount', description='The new total price displayed on the official website.', example='9*'),
            differential?: double(name='Differential', description='The price difference displayed in the total order amount.', example='**'),
            differentialName?: string(name='DifferentialName', description='The name of the price difference.', example='XXXXX'),
            isContractActivity?: boolean(name='IsContractActivity', description='Indicates whether the contract promotion is hit.', example='false'),
            isShow?: string(name='IsShow', description='Indicates whether the price reduction rate is displayed.', example='true'),
            listPrice?: double(name='ListPrice', description='The list price.', example='1*'),
            monthPrice?: double(name='MonthPrice', description='The monthly price.', example='**'),
            originalStandAmount?: double(name='OriginalStandAmount', description='The original total price displayed on the official website.', example='12*'),
          }(name='DepreciateInfo', description='The activity information.'),
          discountFee?: string(name='DiscountFee', description='The discount.', example='0.0'),
          moduleAttrs?: {
            moduleAttr?: [ 
            {
              code?: string(name='Code', description='The attribute code.', example='dds_dbtype'),
              name?: string(name='Name', description='The attribute name.', example='MongoDB'),
              type?: string(name='Type', description='The attribute type.', example='3'),
              value?: string(name='Value', description='The attribute value.', example='MongoDB'),
            }
          ](name='moduleAttr')
          }(name='ModuleAttrs', description='The module attributes.'),
          moduleCode?: string(name='ModuleCode', description='The module code.', example='dds_dbtype'),
          moduleId?: long(name='ModuleId', description='The module ID', example='1017110000415xxx'),
          moduleName?: string(name='ModuleName', description='The module name.', example='database type'),
          needOrderPay?: boolean(name='NeedOrderPay', description='Indicates whether the order is paid.', example='true'),
          payFee?: double(name='PayFee', description='The actual amount paid.', example='0.0'),
          pricingModule?: boolean(name='PricingModule', description='Indicates whether the item is billed.', example='false'),
          promDetailList?: {
            promDetail?: [ 
            {
              activityExtInfo?: map[string]any(name='ActivityExtInfo', description='The additional promotion information.', example='{
    "activityId": "1512010241743170"
}'),
              derivedPromType?: string(name='DerivedPromType', description='The sub-type of the promotion.', example='subPrice'),
              finalPromFee?: double(name='FinalPromFee', description='The discount amount.', example='0.0'),
              optionCode?: string(name='OptionCode', description='The code of the commodity to which the coupon can be applied.', example='wanhua_activity'),
              promType?: string(name='PromType', description='The sub-type of the promotion.', example='discount'),
              promotionCode?: string(name='PromotionCode', description='The coupon code.', example='aliwood-xxx'),
              promotionId?: long(name='PromotionId', description='The ID of the promotional activity.', example='8105187xxxx'),
              promotionName?: string(name='PromotionName', description='The promotional activity name.', example='[Item with price reduction in x xxxx] ApsaraDB for MongoDB instances of a full range of specifications - xxxxx'),
            }
          ](name='PromDetail')
          }(name='PromDetailList', description='The promotion details.'),
          standDiscountPrice?: double(name='StandDiscountPrice', description='The discounted price.', example='451.00'),
          standPrice?: double(name='StandPrice', description='The discount.', example='0'),
          totalProductFee?: double(name='TotalProductFee', description='The original price of the product.', example='0.0'),
          priceType?: string(name='priceType', description='The price type.', example='monthPrice'),
          priceUnit?: string(name='priceUnit', description='The unit of the price.', example='xxxx'),
        }
      ](name='ModuleInstance')
      }(name='ModuleInstance', description='The configuration item of the instance in the order.'),
      optionalPromotions?: {
        optionalPromotion?: [ 
        {
          activityCategory?: string(name='ActivityCategory', description='The activity type.', example='discount'),
          activityExtInfo?: map[string]any(name='ActivityExtInfo', description='The additional activity information.', example='{
    "activityId": "1512010241743170"
}'),
          canPromFee?: double(name='CanPromFee', description='The amount that can be deducted by using the coupon.', example='4560789'),
          optionCode?: string(name='OptionCode', description='The promotion type.', example='wanhua_activity'),
          promotionName?: string(name='PromotionName', description='The promotion name.', example='[Item with price reduction in xxx] ApsaraDB for MongoDB instances of a full range of specifications - xxx'),
          promotionOptionNo?: string(name='PromotionOptionNo', description='The promotion ID.', example='1512010241xxxxx'),
          promotionRuleIdList?: {
            promotionRuleId?: [ string ](name='promotionRuleId')
          }(name='PromotionRuleIdList', description='The promotion IDs.'),
          selected?: boolean(name='Selected', description='Indicates whether', example='false'),
          show?: boolean(name='Show', description='Indicates whether the discount is displayed.', example='true'),
          targetArticleItemCodes?: {
            targetArticleItemCode?: [ string ](name='targetArticleItemCode')
          }(name='TargetArticleItemCodes', description='The specification codes of the product.'),
        }
      ](name='OptionalPromotion')
      }(name='OptionalPromotions', description='The promotional options that can be configured.'),
      originalAmount?: string(name='OriginalAmount', description='The original price of the order.', example='322.4'),
      promDetailList?: {
        promDetail?: [ 
        {
          activityExtInfo?: map[string]any(name='ActivityExtInfo', description='The additional activity information.', example='{
    "activityId": "1512010241743170"
}'),
          derivedPromType?: string(name='DerivedPromType', description='The sub-type of the promotion.', example='subPrice'),
          finalPromFee?: double(name='FinalPromFee', description='The discount amount.', example='0.0'),
          optionCode?: string(name='OptionCode', description='The code of the coupon.', example='youhui_quan'),
          promType?: string(name='PromType', description='The sub-type of the promotion.', example='discount'),
          promotionCode?: string(name='PromotionCode', description='The coupon code.', example='ali-wood'),
          promotionId?: long(name='PromotionId', description='The promotion ID.', example='233xxxxx'),
          promotionName?: string(name='PromotionName', description='The name of the promotional activity.', example='[Item with price reduction in x xxxx] ApsaraDB for MongoDB instances of a full range of specifications - xxxxx'),
        }
      ](name='PromDetail')
      }(name='PromDetailList', description='The promotion details.'),
      ruleIds?: {
        ruleId?: [ string ](name='RuleId')
      }(name='RuleIds', description='The activity rules.'),
      standDiscountPrice?: double(name='StandDiscountPrice', description='The discount.', example='8687'),
      standPrice?: double(name='StandPrice', description='The discount.', example='62982'),
      tradeAmount?: string(name='TradeAmount', description='The actual price of the order.', example='0'),
    }
  ](name='SubOrder')
  }(name='SubOrders', description='The coupon rules.'),
  traceId?: string(name='TraceId', description='The ID of the trace.', example='27227A3D-6B87-56F3-9E03-9E60F001****'),
}

model DescribePriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePriceResponseBody(name='body'),
}

/**
 * @summary Queries the pricing information of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribePriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePriceResponse
 */
async function describePriceWithOptions(request: DescribePriceRequest, runtime: Util.RuntimeOptions): DescribePriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.commodityCode)) {
    query['CommodityCode'] = request.commodityCode;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstances)) {
    query['DBInstances'] = request.DBInstances;
  }
  if (!Util.isUnset(request.orderParamOut)) {
    query['OrderParamOut'] = request.orderParamOut;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePrice',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the pricing information of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribePriceRequest
 * @return DescribePriceResponse
 */
async function describePrice(request: DescribePriceRequest): DescribePriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePriceWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of the values of the returned **RegionName** and **ZoneName** parameters. Valid values:

*   **zh** (default)
*   **en**', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  If you do not specify this parameter, all supported regions are queried.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    ddsRegion?: [ 
    {
      endPoint?: string(name='EndPoint', description='The public endpoint of the region.

For example, if the value of the RegionId parameter in the response is cn-hangzhou, the following value is returned for the EndPoint parameter:

*   mongodb.aliyuncs.com', example='mongodb.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      regionName?: string(name='RegionName', description='The name of the region.

The value of the LocalName parameter is in the language that is specified by the **AcceptLanguage** parameter. For example, if the value of the RegionId parameter in the response is **cn-hangzhou**, the following values are returned for the LocalName parameter:

*   If the value of the **AcceptLanguage** parameter is **zh**, the value **华东1（杭州）** is returned for the LocalName parameter.
*   If the value of the **AcceptLanguage** parameter is **en**, the value **China (Hangzhou)** is returned for the LocalName parameter.', example='China (Hangzhou)'),
      zones?: {
        zone?: [ 
        {
          vpcEnabled?: boolean(name='VpcEnabled', description='Indicates whether a virtual private cloud (VPC) is supported. Valid values:

*   **true**: VPC is supported.
*   **false**: VPC is not supported.', example='true'),
          zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-h'),
          zoneName?: string(name='ZoneName', description='The name of the zone.

The value of the ZoneName parameter is in the language that is specified by the **AcceptLanguage** parameter. For example, if the value of the ZoneId parameter in the response is **cn-hangzhou-h**, the following values are returned for the ZoneName parameter:

*   If the value of the **AcceptLanguage** parameter is **zh**, the value **H** is returned for the ZoneName parameter.
*   If the value of the **AcceptLanguage** parameter is **en**, the value **Hangzhou Zone H** is returned for the ZoneName parameter.', example='Hangzhou Zone H'),
        }
      ](name='Zone')
      }(name='Zones', description='The zones.'),
    }
  ](name='DdsRegion')
  }(name='Regions', description='The regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4E46C22C-D3B7-4DB8-9C76-63851BE68E20'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries all regions and zones supported for an ApsaraDB for MongoDB instance.
 *
 * @description >  To query available regions and zones in which an ApsaraDB for MongoDB instance can be created, call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/149719.html) operation.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all regions and zones supported for an ApsaraDB for MongoDB instance.
 *
 * @description >  To query available regions and zones in which an ApsaraDB for MongoDB instance can be created, call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/149719.html) operation.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRenewalPriceRequest {
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: **youhuiquan_promotion_option_id_for_blank**.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp12c5b040dc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRenewalPriceResponseBody = {
  order?: {
    coupons?: {
      coupon?: [ 
      {
        couponNo?: string(name='CouponNo', description='The coupon number.', example='youhuiquan_promotion_option_id_for_blank'),
        description?: string(name='Description', description='The description of the coupon.', example='coupondemo'),
        isSelected?: string(name='IsSelected', description='Indicates whether the coupon was selected.', example='true'),
        name?: string(name='Name', description='The name of the coupon.', example='youhuiquan111'),
      }
    ](name='Coupon')
    }(name='Coupons', description='Details about the coupons.'),
    currency?: string(name='Currency', description='The type of the currency. Valid values:

*   USD: United States dollar
*   JPY: Japanese Yen', example='USD'),
    discountAmount?: float(name='DiscountAmount', description='The discount amount of the order.', example='1144.8'),
    originalAmount?: float(name='OriginalAmount', description='The original price of the order.', example='1144.8'),
    ruleIds?: {
      ruleId?: [ string ](name='RuleId')
    }(name='RuleIds', description='The IDs of the matched rules.'),
    tradeAmount?: float(name='TradeAmount', description='The actual price of the order.', example='0'),
  }(name='Order', description='The list of orders.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EFD65226-08CC-4C4D-B6A4-CB3C382F67B0'),
  rules?: {
    rule?: [ 
    {
      name?: string(name='Name', description='The name of the rule.', example='demoname'),
      ruleDescId?: long(name='RuleDescId', description='The ID of the rule.', example='11111111'),
      title?: string(name='Title', description='The title of the rule.', example='demo'),
    }
  ](name='Rule')
  }(name='Rules', description='Details about the promotion rules.'),
  subOrders?: {
    subOrder?: [ 
    {
      discountAmount?: float(name='DiscountAmount', description='The discount amount of the order.', example='1144.8'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='dds-bp12c5b040dc****'),
      originalAmount?: float(name='OriginalAmount', description='The original price of the order.', example='1144.8'),
      ruleIds?: {
        ruleId?: [ string ](name='RuleId')
      }(name='RuleIds', description='The IDs of the matched rules.'),
      tradeAmount?: float(name='TradeAmount', description='The actual price of the order.', example='0'),
    }
  ](name='SubOrder')
  }(name='SubOrders', description='The rules matching the coupons.'),
}

model DescribeRenewalPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRenewalPriceResponseBody(name='body'),
}

/**
 * @summary Queries the monthly renewal price of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to subscription instances.
 *
 * @param request DescribeRenewalPriceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRenewalPriceResponse
 */
async function describeRenewalPriceWithOptions(request: DescribeRenewalPriceRequest, runtime: Util.RuntimeOptions): DescribeRenewalPriceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRenewalPrice',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the monthly renewal price of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to subscription instances.
 *
 * @param request DescribeRenewalPriceRequest
 * @return DescribeRenewalPriceResponse
 */
async function describeRenewalPrice(request: DescribeRenewalPriceRequest): DescribeRenewalPriceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRenewalPriceWithOptions(request, runtime);
}

model DescribeReplicaSetRoleRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeReplicaSetRoleResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bpxxxxxxxx'),
  replicaSets?: {
    replicaSet?: [ 
    {
      connectionDomain?: string(name='ConnectionDomain', description='The endpoint of the node.', example='dds-bpxxxxxxxx.mongodb.rds.aliyuncs.com'),
      connectionPort?: string(name='ConnectionPort', description='The port number that is used to connect to the node.', example='3717'),
      connectionType?: string(name='ConnectionType', description='The connection type of the node.', example='SRV'),
      expiredTime?: string(name='ExpiredTime', description='The remaining duration of the classic network endpoint. Unit: seconds.', example='1209582'),
      networkType?: string(name='NetworkType', description='The network type of the instance. Valid values:

*   **VPC**: the virtual private cloud (VPC)
*   **Classic**: the classic network
*   **Public**: the Internet', example='VPC'),
      replicaSetRole?: string(name='ReplicaSetRole', description='The role of the node in the replica set instance. Valid values:

*   **Primary**
*   **Secondary**', example='Primary'),
      roleId?: string(name='RoleId', description='The role ID of the node.', example='651xxxxx'),
    }
  ](name='ReplicaSet')
  }(name='ReplicaSets', description='The details of the roles of the replica set instance.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DB4A0595-FCA9-437F-B2BB-25DBFC009D3E'),
}

model DescribeReplicaSetRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeReplicaSetRoleResponseBody(name='body'),
}

/**
 * @summary Queries the role and connection information of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and standalone instances, but not to sharded cluster instances.
 *
 * @param request DescribeReplicaSetRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeReplicaSetRoleResponse
 */
async function describeReplicaSetRoleWithOptions(request: DescribeReplicaSetRoleRequest, runtime: Util.RuntimeOptions): DescribeReplicaSetRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeReplicaSetRole',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the role and connection information of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and standalone instances, but not to sharded cluster instances.
 *
 * @param request DescribeReplicaSetRoleRequest
 * @return DescribeReplicaSetRoleResponse
 */
async function describeReplicaSetRole(request: DescribeReplicaSetRoleRequest): DescribeReplicaSetRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeReplicaSetRoleWithOptions(request, runtime);
}

model DescribeRestoreDBInstanceListRequest {
  creationTimeAfter?: string(name='CreationTimeAfter', description='Find instances created after the specified time, formatted as <i>yyyy-MM-dd</i>T<i>HH:00:00</i>Z (UTC time).

> 
> - The time must be on the hour.
> - The time cannot be earlier than 7 days before the current time.

This parameter is required.', example='2024-07-24T14:00:00Z'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp114f14849d****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRestoreDBInstanceListResponseBody = {
  DBInstances?: {
    DBInstance?: [ 
    {
      creationTime?: string(name='CreationTime', description='The time of instance creation, formatted as <i>yyyy-MM-dd</i>T<i>HH:00:00</i>Z (UTC time).', example='2022-01-02T07:43:59Z'),
      DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the instance.', example='test-database'),
      DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='dds-bp12c5b040dc****'),
      DBInstanceStatus?: string(name='DBInstanceStatus', description='The status of the instance. For more information, see [Instance states](https://help.aliyun.com/document_detail/63870.html).', example='Running'),
      DBInstanceType?: string(name='DBInstanceType', description='The architecture of the instance. Valid values:

*   **sharding**: sharded cluster instance
*   **replicate**: replica set or standalone instance', example='replicate'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Valid values:

*   **7.0**
*   **6.0**
*   **5.0**
*   **4.4**
*   **4.2**
*   **4.0**
*   **3.4**', example='4.2'),
      hiddenZoneId?: string(name='HiddenZoneId', description='The secondary availability zone 2 for the instance when implementing multi-AZ deployment.', example='cn-hangzhou-h'),
      isDeleted?: int32(name='IsDeleted', description='Specifies whether the instance is deleted. Valid values:

*   **0**: not deleted
*   **1**: deleted', example='0'),
      lockMode?: string(name='LockMode', description='The locked state of the instance, value description:
- Unlock: Normal.
- ManualLock: Manually triggered lock.
- LockByExpiration: Automatically locked due to expiration.
- LockByRestoration: Automatically locked before restoration.
- LockByDiskQuota: Automatically locked due to disk quota exceeded.', example='Unlock'),
      regionId?: string(name='RegionId', description='The region ID of the instance.', example='cn-hangzhou'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The secondary availability zone 1 for the instance when implementing multi-AZ deployment.', example='cn-hangzhou-i'),
      zoneId?: string(name='ZoneId', description='The zone ID of the instance.', example='cn-hangzhou-g'),
    }
  ](name='DBInstance')
  }(name='DBInstances', description='DB instances list.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AF0AD89-ED4F-44AD-B65F-BFC1D5Cxxxxx'),
  totalCount?: int32(name='TotalCount', description='The number of instances in the query results.', example='5'),
}

model DescribeRestoreDBInstanceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRestoreDBInstanceListResponseBody(name='body'),
}

/**
 * @summary Queries ApsaraDB for MongoDB instances whose backups are restored within seven days.
 *
 * @param request DescribeRestoreDBInstanceListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRestoreDBInstanceListResponse
 */
async function describeRestoreDBInstanceListWithOptions(request: DescribeRestoreDBInstanceListRequest, runtime: Util.RuntimeOptions): DescribeRestoreDBInstanceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.creationTimeAfter)) {
    query['CreationTimeAfter'] = request.creationTimeAfter;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRestoreDBInstanceList',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries ApsaraDB for MongoDB instances whose backups are restored within seven days.
 *
 * @param request DescribeRestoreDBInstanceListRequest
 * @return DescribeRestoreDBInstanceListResponse
 */
async function describeRestoreDBInstanceList(request: DescribeRestoreDBInstanceListRequest): DescribeRestoreDBInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRestoreDBInstanceListWithOptions(request, runtime);
}

model DescribeRoleZoneInfoRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRoleZoneInfoResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='728B9A96-E262-4AE5-915E-3A51CCE2FDA9'),
  zoneInfos?: {
    zoneInfo?: [ 
    {
      insName?: string(name='InsName', description='The ID of the node.', example='dds-bpxxxxxxxx'),
      nodeType?: string(name='NodeType', description='The type of the node. Valid values:

*   **normal**
*   **configServer**
*   **shard**
*   **mongos**

> Valid value for replica set instances: **normal**. Valid values for sharded cluster instances: **configServer**, **shard**, and **mongos**.', example='normal'),
      roleId?: string(name='RoleId', description='The role ID.', example='83xxxxx'),
      roleType?: string(name='RoleType', description='The role of the node. Valid values:

*   **Primary**
*   **Secondary**
*   **Hidden**', example='Primary'),
      zoneId?: string(name='ZoneId', description='The zone ID of the node.', example='cn-hangzhou-e'),
    }
  ](name='ZoneInfo')
  }(name='ZoneInfos', description='The information of nodes in the zone.'),
}

model DescribeRoleZoneInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRoleZoneInfoResponseBody(name='body'),
}

/**
 * @summary Queries the role and zone of each node in an ApsaraDB for MongoDB instance.
 *
 * @description > For more information, see [View the zone of a node](https://help.aliyun.com/document_detail/123825.html).
 * This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances.
 *
 * @param request DescribeRoleZoneInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRoleZoneInfoResponse
 */
async function describeRoleZoneInfoWithOptions(request: DescribeRoleZoneInfoRequest, runtime: Util.RuntimeOptions): DescribeRoleZoneInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRoleZoneInfo',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the role and zone of each node in an ApsaraDB for MongoDB instance.
 *
 * @description > For more information, see [View the zone of a node](https://help.aliyun.com/document_detail/123825.html).
 * This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances.
 *
 * @param request DescribeRoleZoneInfoRequest
 * @return DescribeRoleZoneInfoResponse
 */
async function describeRoleZoneInfo(request: DescribeRoleZoneInfoRequest): DescribeRoleZoneInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRoleZoneInfoWithOptions(request, runtime);
}

model DescribeRunningLogRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bpxxxxxxxx'),
  DBName?: string(name='DBName', description='The name of the database.', example='mongodbtest'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

>  The end time must be later than the start time and within 24 hours from the start time. Otherwise, the query fails.

This parameter is required.', example='2019-01-01T13:10Z'),
  logicalOperator?: string(name='LogicalOperator', description='The logical relationship among multiple keywords.

*   **or**
*   **and** (default value)', example='and'),
  nodeId?: string(name='NodeId', description='The ID of the mongos node or shard node whose operational logs you want to query in the instance. If the instance is a sharded cluster instance, you must specify this parameter.

>  This parameter is valid only when **DBInstanceId** is set to the ID of a sharded cluster instance.', example='d-bpxxxxxxxx'),
  orderType?: string(name='OrderType', description='The order of time in which the operational log entries to return are sorted. Valid values:

*   asc: The log entries are sorted by time in ascending order.
*   desc: The log entries are sorted by time in descending order.', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30** to **100**.', example='30'),
  queryKeywords?: string(name='QueryKeywords', description='The keywords used for query. You can enter up to 10 keywords at a time. If you enter multiple keywords, separate the keywords with spaces.', example='test test2'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='sg-bpxxxxxxxxxxxxxxxxxx'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleId?: string(name='RoleId', description='The role ID of the node. You can call the [DescribeReplicaSetRole](https://help.aliyun.com/document_detail/62134.html) operation to query the role ID.', example='651xxxxx'),
  roleType?: string(name='RoleType', description='The role of the node whose error logs you want to query in the instance. Valid values:

*   **primary**
*   **secondary**

>  If you set the **NodeId** parameter to the ID of a mongos node, the **RoleType** parameter must be set to **primary**.', example='primary'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2019-01-01T12:10Z'),
}

model DescribeRunningLogRecordsResponseBody = {
  engine?: string(name='Engine', description='The database engine.', example='MongoDB'),
  items?: {
    logRecords?: [ 
    {
      category?: string(name='Category', description='The category of the log entry.', example='NETWORK'),
      connInfo?: string(name='ConnInfo', description='The connection information of the log entry.', example='conn18xxxxxx'),
      content?: string(name='Content', description='The content of the log entry.', example='end connection 11.xxx.xxx.xx:3xxxx (0 connections now open)\\\\n'),
      createTime?: string(name='CreateTime', description='The time when the log entry was generated. The time is in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-26T12:09:34Z'),
    }
  ](name='LogRecords')
  }(name='Items', description='Details about the operational log entries.'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='45D2B592-DEBA-4347-BBF3-47FF6C97DBBC'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries.', example='2'),
}

model DescribeRunningLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRunningLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries entries in operational logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeRunningLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRunningLogRecordsResponse
 */
async function describeRunningLogRecordsWithOptions(request: DescribeRunningLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeRunningLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.logicalOperator)) {
    query['LogicalOperator'] = request.logicalOperator;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryKeywords)) {
    query['QueryKeywords'] = request.queryKeywords;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRunningLogRecords',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries entries in operational logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeRunningLogRecordsRequest
 * @return DescribeRunningLogRecordsResponse
 */
async function describeRunningLogRecords(request: DescribeRunningLogRecordsRequest): DescribeRunningLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRunningLogRecordsWithOptions(request, runtime);
}

model DescribeSecurityGroupConfigurationRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSecurityGroupConfigurationResponseBody = {
  items?: {
    rdsEcsSecurityGroupRel?: [ 
    {
      netType?: string(name='NetType', description='The network type of the ECS security group. Valid values:

*   **vpc**
*   **classic**', example='vpc'),
      regionId?: string(name='RegionId', description='The region ID of the ECS security group.', example='cn-hangzhou'),
      securityGroupId?: string(name='SecurityGroupId', description='The ID of the ECS security group.', example='sg-bpxxxxxxxx'),
    }
  ](name='RdsEcsSecurityGroupRel')
  }(name='Items', description='Details about the ECS security groups.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3C4A2494-85C4-45C5-93CF-548DB3375193'),
}

model DescribeSecurityGroupConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityGroupConfigurationResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query ECS security groups that are bound to an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeSecurityGroupConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityGroupConfigurationResponse
 */
async function describeSecurityGroupConfigurationWithOptions(request: DescribeSecurityGroupConfigurationRequest, runtime: Util.RuntimeOptions): DescribeSecurityGroupConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecurityGroupConfiguration',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query ECS security groups that are bound to an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeSecurityGroupConfigurationRequest
 * @return DescribeSecurityGroupConfigurationResponse
 */
async function describeSecurityGroupConfiguration(request: DescribeSecurityGroupConfigurationRequest): DescribeSecurityGroupConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecurityGroupConfigurationWithOptions(request, runtime);
}

model DescribeSecurityIpsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  showHDMIps?: boolean(name='ShowHDMIps', description='Whether to display DAS whitelist information.', example='true'),
}

model DescribeSecurityIpsResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FC724D23-2962-479E-ABB1-606C935AE7FD'),
  securityIpGroups?: {
    securityIpGroup?: [ 
    {
      securityIpGroupAttribute?: string(name='SecurityIpGroupAttribute', description='The attribute of the IP address whitelist.', example='hidden'),
      securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the IP whitelist.', example='default'),
      securityIpList?: string(name='SecurityIpList', description='The name of the IP whitelist.', example='47.xxx.xxx.xx,100.xxx.xxx.0/24'),
    }
  ](name='SecurityIpGroup')
  }(name='SecurityIpGroups', description='An array that consists of the information of IP whitelists.'),
  securityIps?: string(name='SecurityIps', description='The IP addresses in the default whitelist.', example='47.xxx.xxx.xx,100.xxx.xxx.0/24'),
}

model DescribeSecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityIpsResponseBody(name='body'),
}

/**
 * @summary You can call this operation to query the IP whitelists of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeSecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIpsWithOptions(request: DescribeSecurityIpsRequest, runtime: Util.RuntimeOptions): DescribeSecurityIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.showHDMIps)) {
    query['ShowHDMIps'] = request.showHDMIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecurityIps',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to query the IP whitelists of an ApsaraDB for MongoDB instance.
 *
 * @param request DescribeSecurityIpsRequest
 * @return DescribeSecurityIpsResponse
 */
async function describeSecurityIps(request: DescribeSecurityIpsRequest): DescribeSecurityIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecurityIpsWithOptions(request, runtime);
}

model DescribeShardingNetworkAddressRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the mongos, shard, or Configserver node in the sharded cluster instance.

>  You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the ID of the mongos, shard, or Configserver node.', example='d-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeShardingNetworkAddressResponseBody = {
  compatibleConnections?: {
    compatibleConnection?: [ 
    {
      expiredTime?: string(name='ExpiredTime', description='The remaining duration of the classic network endpoint. Unit: seconds.', example='2591963'),
      IPAddress?: string(name='IPAddress', description='The IP address of the instance.', example='10.140.xxx.xx'),
      networkAddress?: string(name='NetworkAddress', description='The endpoint of the instance.', example='dds-bpxxxxxxxxxxxxxx.mongodb.rds.aliyuncs.com'),
      networkType?: string(name='NetworkType', description='The network type of the instance.

*   **VPC**: virtual private cloud
*   **Classic**: classic network
*   **Public**: the Internet', example='VPC'),
      port?: string(name='Port', description='The port that is used to connect to the instance.', example='3717'),
      VPCId?: string(name='VPCId', description='The VPC ID of the instance.

>  This parameter is returned when the network type is **VPC**.', example='vpc-bpxxxxxxxx'),
      vswitchId?: string(name='VswitchId', description='The ID of the vSwitch in the Virtual Private Cloud (VPC).

>  This parameter is returned when the network type is **VPC**.', example='vsw-bpxxxxxxxx'),
    }
  ](name='CompatibleConnection')
  }(name='CompatibleConnections', description='The endpoints of DynamoDB-compatible instances.'),
  networkAddresses?: {
    networkAddress?: [ 
    {
      connectionType?: string(name='ConnectionType', description='The public endpoint type. Valid values:

*   **SRV**
*   **Normal**', example='SRV'),
      expiredTime?: string(name='ExpiredTime', description='The remaining duration of the classic network endpoint. Unit: seconds.', example='2591963'),
      IPAddress?: string(name='IPAddress', description='The IP address of the instance.', example='10.140.xxx.xx'),
      networkAddress?: string(name='NetworkAddress', description='The connection string of the instance.', example='s-bpxxxxxxxx.mongodb.rds.aliyuncs.com'),
      networkType?: string(name='NetworkType', description='The network type of the instance.

*   **VPC**: virtual private cloud
*   **Classic**: classic network
*   **Public**: the Internet', example='VPC'),
      nodeId?: string(name='NodeId', description='The ID of the mongos node.', example='s-bpxxxxxxxx'),
      nodeType?: string(name='NodeType', description='The type of the node. Valid values:

*   **mongos**: mongos node
*   **shard**: shard node
*   **configserver**: Configserver node', example='mongos'),
      port?: string(name='Port', description='The port that is used to connect to the instance.', example='3717'),
      role?: string(name='Role', description='The role of the node. Valid values:

*   Primary
*   Secondary', example='Primary'),
      txtRecord?: string(name='TxtRecord', description='Txt record which can be used to store MongoDB-related meta data, such as version, configuration parameters and etc. With the combination of txt record and other technology, for example SRV record, the MongoDB client can complete the complex service discovery and configuration passing.', example='mongo.example.com. IN TXT "config=replicaSet=myReplicaSet"'),
      VPCId?: string(name='VPCId', description='The VPC ID of the instance.

>  This parameter is returned when the network type is **VPC**.', example='vpc-bpxxxxxxxx'),
      vswitchId?: string(name='VswitchId', description='The ID of the vSwitch in the VPC.

>  This parameter is returned when the network type is **VPC**.', example='vsw-bpxxxxxxxx'),
    }
  ](name='NetworkAddress')
  }(name='NetworkAddresses', description='The endpoints of the ApsaraDB for MongoDB sharded cluster instance.'),
  requestId?: string(name='RequestId', description='The request ID.', example='18D8AAFD-6BEB-420F-8164-810CB0C0AA39'),
}

model DescribeShardingNetworkAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeShardingNetworkAddressResponseBody(name='body'),
}

/**
 * @summary Queries connection information about an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description This operation is applicable only to sharded cluster instances.
 *
 * @param request DescribeShardingNetworkAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeShardingNetworkAddressResponse
 */
async function describeShardingNetworkAddressWithOptions(request: DescribeShardingNetworkAddressRequest, runtime: Util.RuntimeOptions): DescribeShardingNetworkAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeShardingNetworkAddress',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries connection information about an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description This operation is applicable only to sharded cluster instances.
 *
 * @param request DescribeShardingNetworkAddressRequest
 * @return DescribeShardingNetworkAddressResponse
 */
async function describeShardingNetworkAddress(request: DescribeShardingNetworkAddressRequest): DescribeShardingNetworkAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeShardingNetworkAddressWithOptions(request, runtime);
}

model DescribeSlowLogRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

> If you set this parameter to the ID of a sharded cluster instance, you must also specify the `NodeId` parameter.

This parameter is required.', example='dds-bp1fc7e65108****'),
  DBName?: string(name='DBName', description='The name of the database.', example='mongodbtest'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

> 

*   The end time must be later than the start time.

*   The end time must be within 24 hours from the start time. Otherwise, the query fails.

This parameter is required.', example='2021-08-16T14:13Z'),
  logicalOperator?: string(name='LogicalOperator', description='The logical relationship among multiple keywords.

*   **or**
*   **and** (default value)', example='and'),
  nodeId?: string(name='NodeId', description='The ID of the shard node.

> This parameter is required only when you specify the `DBInstanceId` parameter to the ID of a sharded cluster instance.', example='d-bp18b06ebc21****'),
  orderType?: string(name='OrderType', description='The order of time in which the log entries to return are sorted. Valid values:

*   asc: The log entries are sorted by time in ascending order.
*   desc: The log entries are sorted by time in descending order.', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number of the page to return. The value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30** to **100**.', example='30'),
  queryKeywords?: string(name='QueryKeywords', description='The keywords used for query. You can enter up to 10 keywords at a time. If you enter multiple keywords, separate the keywords with spaces.', example='test test1'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instances you want to query belong.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='2021-08-15T14:13Z'),
}

model DescribeSlowLogRecordsResponseBody = {
  engine?: string(name='Engine', description='The database engine.', example='MongoDB'),
  items?: {
    logRecords?: [ 
    {
      accountName?: string(name='AccountName', description='The username of the database account that performs the operation.', example='test'),
      DBName?: string(name='DBName', description='The name of the database.', example='mongodbtest'),
      docsExamined?: long(name='DocsExamined', description='The number of documents that are scanned during the operation.', example='1000000'),
      executionStartTime?: string(name='ExecutionStartTime', description='The start time of the operation. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2019-02-25T 01:41:28Z'),
      hostAddress?: string(name='HostAddress', description='The host IP address that is used to connect to the database.', example='192.168.XX.XX'),
      keysExamined?: long(name='KeysExamined', description='The number of rows involved in index scans.', example='0'),
      queryTimes?: string(name='QueryTimes', description='The execution time of the statement. Unit: milliseconds.', example='600'),
      returnRowCounts?: long(name='ReturnRowCounts', description='The number of rows returned by the SQL statement.', example='0'),
      SQLText?: string(name='SQLText', description='The SQL statement that is executed during the slow operation.', example='{\\\\"op\\\\":\\\\"query\\\\",\\\\"ns\\\\":\\\\"mongodbtest.customer\\\\",\\\\"query\\\\":{\\\\"find\\\\":\\\\"customer\\\\",\\\\"filter\\\\":{\\\\"name\\\\":\\\\"jack\\\\"}}}'),
      tableName?: string(name='TableName', description='The name of the collection.', example='C1'),
    }
  ](name='LogRecords')
  }(name='Items', description='An array that consists of the information about each slow query.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page. The value is a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: **1**.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of slow query log entries returned on the page.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='8076C4BA-DDBD-529C-BFF4-D8620C3F****'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of returned entries.', example='1'),
}

model DescribeSlowLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the details of entries in slow query logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeSlowLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecordsWithOptions(request: DescribeSlowLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeSlowLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.logicalOperator)) {
    query['LogicalOperator'] = request.logicalOperator;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryKeywords)) {
    query['QueryKeywords'] = request.queryKeywords;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlowLogRecords',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of entries in slow query logs of an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request DescribeSlowLogRecordsRequest
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecords(request: DescribeSlowLogRecordsRequest): DescribeSlowLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowLogRecordsWithOptions(request, runtime);
}

model DescribeTagsRequest {
  nextToken?: string(name='NextToken', description='The token used to start the next query to retrieve more results.

>  This parameter is not required in the first query. If not all results are returned in one query, you can pass in the NextToken value returned in the previous query to perform the query again.', example='212db86****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='dds-bp17e7a04960****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.', example='INSTANCE'),
}

model DescribeTagsResponseBody = {
  nextToken?: string(name='NextToken', description='The token used to start the next query.

>  If not all results are returned in the first query, this parameter is returned. You can pass in the value of this parameter in the next query.', example='212db86****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EEDBE38F-5CF5-4316-AAC2-35817BA60D68'),
  tags?: [ 
    {
      tagKey?: string(name='TagKey', description='The key of the tag.', example='newKey'),
      tagValues?: [ string ](name='TagValues', description='The values of the tags.'),
    }
  ](name='Tags', description='Details about the tags.'),
}

model DescribeTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagsResponseBody(name='body'),
}

/**
 * @summary Queries all tags in a specified region.
 *
 * @param request DescribeTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagsResponse
 */
async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: Util.RuntimeOptions): DescribeTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTags',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries all tags in a specified region.
 *
 * @param request DescribeTagsRequest
 * @return DescribeTagsResponse
 */
async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model DescribeUserEncryptionKeyListRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  targetRegionId?: string(name='TargetRegionId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent zone list.', example='cn-shanghai'),
}

model DescribeUserEncryptionKeyListResponseBody = {
  keyIds?: {
    keyId?: [ string ](name='KeyId')
  }(name='KeyIds', description='The list of custom keys.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7CD51DA4-A499-43CE-B9B5-20CD4FDC648E'),
}

model DescribeUserEncryptionKeyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserEncryptionKeyListResponseBody(name='body'),
}

/**
 * @summary Queries the list of custom keys for an ApsaraDB for MongoDB instance.
 *
 * @description You can use the custom key obtained by calling the DescribeUserEncryptionKeyList operation to enable TDE. For more information, see [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html).
 *
 * @param request DescribeUserEncryptionKeyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserEncryptionKeyListResponse
 */
async function describeUserEncryptionKeyListWithOptions(request: DescribeUserEncryptionKeyListRequest, runtime: Util.RuntimeOptions): DescribeUserEncryptionKeyListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.targetRegionId)) {
    query['TargetRegionId'] = request.targetRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserEncryptionKeyList',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the list of custom keys for an ApsaraDB for MongoDB instance.
 *
 * @description You can use the custom key obtained by calling the DescribeUserEncryptionKeyList operation to enable TDE. For more information, see [ModifyDBInstanceTDE](https://help.aliyun.com/document_detail/131267.html).
 *
 * @param request DescribeUserEncryptionKeyListRequest
 * @return DescribeUserEncryptionKeyListResponse
 */
async function describeUserEncryptionKeyList(request: DescribeUserEncryptionKeyListRequest): DescribeUserEncryptionKeyListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserEncryptionKeyListWithOptions(request, runtime);
}

model DestroyInstanceRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

> **InstanceId** and **DBInstanceId** serve the same function. You need only to specify one of them.', example='dds-bp147acd4783****'),
  instanceId?: string(name='InstanceId', description='The instance ID.

> **InstanceId** and **DBInstanceId** serve the same function. You need only to specify one of them.', example='dds-bp147acd4783****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DestroyInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='65BDA532-28AF-4122-AA39-B382721E****'),
}

model DestroyInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DestroyInstanceResponseBody(name='body'),
}

/**
 * @summary Destroys an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a replica set instance or a sharded cluster instance that uses local disks.
 * *   The billing method of the instance is subscription.
 * *   The instance has expired and is in the **Locking** state.
 * **
 * **Warning** Data cannot be restored after the instance is destroyed. Proceed with caution.
 *
 * @param request DestroyInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DestroyInstanceResponse
 */
async function destroyInstanceWithOptions(request: DestroyInstanceRequest, runtime: Util.RuntimeOptions): DestroyInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DestroyInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Destroys an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is a replica set instance or a sharded cluster instance that uses local disks.
 * *   The billing method of the instance is subscription.
 * *   The instance has expired and is in the **Locking** state.
 * **
 * **Warning** Data cannot be restored after the instance is destroyed. Proceed with caution.
 *
 * @param request DestroyInstanceRequest
 * @return DestroyInstanceResponse
 */
async function destroyInstance(request: DestroyInstanceRequest): DestroyInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return destroyInstanceWithOptions(request, runtime);
}

model EvaluateResourceRequest {
  DBInstanceClass?: string(name='DBInstanceClass', description='The type of the instance.

> This parameter is required when you check whether resources are sufficient for creating or upgrading a replica set instance. For more information about instance types, see [Instance types](https://help.aliyun.com/document_detail/57141.html).', example='dds.mongo.mid'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance. This parameter is required when you check whether resources are sufficient for upgrading an instance.', example='dds-bp14bf67a76d****'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to **MongoDB**.', example='MongoDB'),
  engineVersion?: string(name='EngineVersion', description='The version of the database engine.

This parameter is required.', example='4.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readonlyReplicas?: string(name='ReadonlyReplicas', description='The number of read-only nodes in the instance. Valid values: **1** to **5**.

> This parameter is not required for standalone or serverless instances.', example='1'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the region ID.

This parameter is required.', example='cn-hangzhou'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

*   Set the value to **1** for standalone instances.
*   Valid values for replica set instances: **3**, **5**, and **7**

> This parameter is not required for serverless instances.', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  shardsInfo?: string(name='ShardsInfo', description='The node information about the sharded cluster instance. This parameter is required when you check whether resources are sufficient for creating or upgrading a sharded cluster instance.

To check whether resources are sufficient for creating a sharded cluster instance, specify the specifications of each node in the instance. The value must be a JSON string. Example:

    {
         "ConfigSvrs":
             [{"Storage":20,"DBInstanceClass":"dds.cs.mid"}],
         "Mongos":
             [{"DBInstanceClass":"dds.mongos.standard"},{"DBInstanceClass":"dds.mongos.standard"}],
         "Shards":
             [{"Storage":50,"DBInstanceClass":"dds.shard.standard"},{"Storage":50,"DBInstanceClass":"dds.shard.standard"},   {"Storage":50,"DBInstanceClass":"dds.shard.standard"}]
     }

Parameters in the example:

*   ConfigSvrs: the Configserver node.
*   Mongos: the mongos node.
*   Shards: the shard node.
*   Storage: the storage space of the node.
*   DBInstanceClass: the instance type of the node. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).

To check whether resources are sufficient for upgrading a single node of a sharded cluster instance, specify only the information about the node to be upgraded. The value must be a JSON string. Example:

    {
         "NodeId": "d-bp147c4d9ca7****", "NodeClass": "dds.shard.standard"
    } 

Parameters in the example:

*   NodeId: the ID of the node.
*   NodeClass: the instance type of the node. For more information, see [Sharded cluster instance types](https://help.aliyun.com/document_detail/311414.html).', example='{"NodeId": "d-bp147c4d9ca7****", "NodeClass": "dds.shard.standard"}'),
  storage?: string(name='Storage', description='The storage capacity of the replica set instance. Unit: GB.

> This parameter is required for the instances that use cloud disks.', example='10'),
  zoneId?: string(name='ZoneId', description='The zone ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the zone ID.

This parameter is required.', example='cn-hangzhou-h'),
}

model EvaluateResourceResponseBody = {
  DBInstanceAvailable?: string(name='DBInstanceAvailable', description='Indicates whether the resources are sufficient in the region. Valid values:

*   **1**: The resources are sufficient.
*   **0**: The resources are insufficient.', example='1'),
  engine?: string(name='Engine', description='The database engine of the instance. Only MongoDB is returned.', example='MongoDB'),
  engineVersion?: string(name='EngineVersion', description='The version of the database engine.', example='4.0'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AE2DE465-E45F-481F-ABD8-37D64173****'),
}

model EvaluateResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EvaluateResourceResponseBody(name='body'),
}

/**
 * @summary Checks whether sufficient resources are available in a region in which you want to create or upgrade an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances. You can call this operation to check whether resources are sufficient for creating an instance, upgrading a replica set or sharded cluster instance, or upgrading a single node of the sharded cluster instance.
 * > You can call this operation a maximum of 200 times per minute.
 *
 * @param request EvaluateResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EvaluateResourceResponse
 */
async function evaluateResourceWithOptions(request: EvaluateResourceRequest, runtime: Util.RuntimeOptions): EvaluateResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.readonlyReplicas)) {
    query['ReadonlyReplicas'] = request.readonlyReplicas;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.shardsInfo)) {
    query['ShardsInfo'] = request.shardsInfo;
  }
  if (!Util.isUnset(request.storage)) {
    query['Storage'] = request.storage;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EvaluateResource',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Checks whether sufficient resources are available in a region in which you want to create or upgrade an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances. You can call this operation to check whether resources are sufficient for creating an instance, upgrading a replica set or sharded cluster instance, or upgrading a single node of the sharded cluster instance.
 * > You can call this operation a maximum of 200 times per minute.
 *
 * @param request EvaluateResourceRequest
 * @return EvaluateResourceResponse
 */
async function evaluateResource(request: EvaluateResourceRequest): EvaluateResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return evaluateResourceWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The token used to start the next query to retrieve more results.

>  This parameter is not required in the first query. If not all results are returned in one query, you can pass in the **NextToken** value returned in the previous query to perform the query again.', example='212db86****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs. You must specify this parameter or the Tag parameter.', example='dds-bpxxxxxxxx'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag.', example='env'),
      value?: string(name='Value', description='The value of tag.', example='dev'),
    }
  ](name='Tag', description='The tags that are attached to the resources.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The token used to start the next query.

>  If not all results are returned in the first query, this parameter is returned. You can pass in the returned value of this parameter in the next query.', example='212db86****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='96017AF2-9AB1-4BC9-88D2-7966B3CD****'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The ID of the resource. It is the ID of the ApsaraDB for MongoDB instance.', example='dds-bp17e7a04960****'),
      resourceType?: string(name='ResourceType', description='The resource type. The return value is fixed to **ALIYUN: KVSTORE: INSTANCE**, indicating an ApsaraDB for MongoDB instance.', example='ALIYUN::DDS::INSTANCE'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='Environment'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='dev'),
    }
  ](name='TagResource')
  }(name='TagResources', description='Details about the tags of the instance.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the relationship between ApsaraDB for MongoDB instances and tags.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the relationship between ApsaraDB for MongoDB instances and tags.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model MigrateAvailableZoneRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

> If the instance is deployed in a VPC, you must specify the **Vswitch** parameter.

This parameter is required.', example='dds-bp1ece71ff2f****'),
  effectiveTime?: string(name='EffectiveTime', description='The time when the instance is migrated to the destination zone. Valid values:

*   **Immediately**: The instance is immediately migrated to the destination zone.
*   **MaintainTime**: The instance is migrated to the destination zone during the maintenance window of the instance.

Default value: **Immediately**.', example='Immediately'),
  hiddenZoneId?: string(name='HiddenZoneId', description='The ID of the destination hidden zone.', example='cn-shanghai-n'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the destination secondary zone.', example='cn-hangzhou-h'),
  vswitch?: string(name='Vswitch', description='The ID of the vSwitch in the destination zone.

> If the instance is deployed in a VPC, you must specify this parameter.', example='vsw-bp1buy0h9myt5i9e7****'),
  zoneId?: string(name='ZoneId', description='The ID of the destination zone.

> 

*   The source zone and the destination zone belong to the same region.

*   You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the zone ID.

This parameter is required.', example='cn-hangzhou-b'),
}

model MigrateAvailableZoneResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0FDDC511-7252-4A4A-ADDA-5CB1BF63****'),
}

model MigrateAvailableZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateAvailableZoneResponseBody(name='body'),
}

/**
 * @summary Migrates an ApsaraDB for MongoDB instance to a specific zone.
 *
 * @description *   This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances.
 * *   If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation to release the public endpoint before you call the MigrateAvailableZone operation.
 * *   Transparent data encryption (TDE) is disabled for the ApsaraDB for MongoDB instance.
 * *   The source zone and the destination zone belong to the same region.
 * *   A vSwitch is created in the destination zone. This prerequisite must be met if the instance resides in a virtual private cloud (VPC). For more information about how to create a vSwitch, see [Work with vSwitches](https://help.aliyun.com/document_detail/65387.html).
 *
 * @param request MigrateAvailableZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateAvailableZoneResponse
 */
async function migrateAvailableZoneWithOptions(request: MigrateAvailableZoneRequest, runtime: Util.RuntimeOptions): MigrateAvailableZoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.hiddenZoneId)) {
    query['HiddenZoneId'] = request.hiddenZoneId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!Util.isUnset(request.vswitch)) {
    query['Vswitch'] = request.vswitch;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MigrateAvailableZone',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Migrates an ApsaraDB for MongoDB instance to a specific zone.
 *
 * @description *   This operation is available only for replica set instances that run MongoDB 4.2 or earlier and sharded cluster instances.
 * *   If you have applied for a public endpoint for the ApsaraDB for MongoDB instance, you must call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation to release the public endpoint before you call the MigrateAvailableZone operation.
 * *   Transparent data encryption (TDE) is disabled for the ApsaraDB for MongoDB instance.
 * *   The source zone and the destination zone belong to the same region.
 * *   A vSwitch is created in the destination zone. This prerequisite must be met if the instance resides in a virtual private cloud (VPC). For more information about how to create a vSwitch, see [Work with vSwitches](https://help.aliyun.com/document_detail/65387.html).
 *
 * @param request MigrateAvailableZoneRequest
 * @return MigrateAvailableZoneResponse
 */
async function migrateAvailableZone(request: MigrateAvailableZoneRequest): MigrateAvailableZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return migrateAvailableZoneWithOptions(request, runtime);
}

model MigrateToOtherZoneRequest {
  effectiveTime?: string(name='EffectiveTime', description='The time when the instance is migrated to the destination zone. Valid values:

*   **Immediately** (default): The instance is migrated immediately.
*   **MaintainTime**: The instance is migrated during its maintenance window.', example='Immediately'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

>  If the network type of the instance is VPC, you must specify the **Vswitch** parameter .

This parameter is required.', example='dds-bp2658****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the destination zone.

>  This parameter is valid and required only when the network type of the instance is VPC.', example='vsw-bp67ac****'),
  zoneId?: string(name='ZoneId', description='The ID of the destination zone to which you want to migrate the ApsaraDB for MongoDB instance.

> * The destination and source zones must be in one region.
> * You can call [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) to query the zone IDs.

This parameter is required.', example='cn-hangzhou-b'),
}

model MigrateToOtherZoneResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='0FDDC511-7252-4A4A-ADDA-5CB1BF63873D'),
}

model MigrateToOtherZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateToOtherZoneResponseBody(name='body'),
}

/**
 * @summary You can call this operation to migrate an ApsaraDB for MongoDB instance to another zone.
 *
 * @description This operation is applicable only to replica set instances, but not to standalone instances or sharded cluster instances.
 * >  If you have applied for a public endpoint of the instance, you must first call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation to release the public endpoint.
 *
 * @param request MigrateToOtherZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateToOtherZoneResponse
 */
async function migrateToOtherZoneWithOptions(request: MigrateToOtherZoneRequest, runtime: Util.RuntimeOptions): MigrateToOtherZoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MigrateToOtherZone',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to migrate an ApsaraDB for MongoDB instance to another zone.
 *
 * @description This operation is applicable only to replica set instances, but not to standalone instances or sharded cluster instances.
 * >  If you have applied for a public endpoint of the instance, you must first call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation to release the public endpoint.
 *
 * @param request MigrateToOtherZoneRequest
 * @return MigrateToOtherZoneResponse
 */
async function migrateToOtherZone(request: MigrateToOtherZoneRequest): MigrateToOtherZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return migrateToOtherZoneWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the account.

*   The description must start with a letter and cannot start with http:// or https://.
*   The description must be 2 to 256 characters in length, and can contain letters, digits, underscores (_), and hyphens (-).

This parameter is required.', example='superadmin'),
  accountName?: string(name='AccountName', description='The name of the account whose description is to be modified.

This parameter is required.', example='root'),
  characterType?: string(name='CharacterType', description='The type of the account whose description you can modify. Valid values:

*   **db**: shard account
*   **cs**: ConfigServer account
*   **normal** (default): replica set account (available)

>  You can set this parameter only to **normal**.', example='normal'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp2356****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='59DE9FC2-7B40-45CF-9011-7327A8A771A2'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the description of the root account in an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: Util.RuntimeOptions): ModifyAccountDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAccountDescription',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the description of the root account in an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyActiveOperationTasksRequest {
  ids?: string(name='Ids', description='The IDs of the O\\\\&M tasks. Separate multiple task IDs with commas (,).

>  You can call the DescribeActiveOperationTask operation to query the IDs of O\\\\&M tasks.

This parameter is required.', example='11111,22222'),
  immediateStart?: int32(name='ImmediateStart', description='Specifies whether to immediately start scheduling. Valid values:

*   0 (default): Scheduling is not started immediately.
*   1: Scheduling is started immediately.

> -   If you set this parameter to 0, the SwitchTime parameter takes effect. If you set this parameter to 1, the SwitchTime parameter does not take effect. In this case, the start time of the task is the current time, and the system determines the switching time based on the start time.
> -   Immediate scheduling specifies that the task enters the preparing state instead of being executed immediately. After the preparation is complete, the switchover is performed. You can call the DescribeActiveOperationTasks operation to query the preparation time that is returned for the PrepareInterval parameter.', example='0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTime?: string(name='SwitchTime', description='The scheduled switching time that you want to specify. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

>  The time that is specified by the SwitchTime parameter cannot be later than the time that is specified by the Deadline parameter. You can call the DescribeActiveOperationTasks operation to query the latest switching time that is returned for the Deadline parameter.

This parameter is required.', example='2019-10-17T18:50:00Z'),
}

model ModifyActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', description='The IDs of the O\\\\&M tasks. Multiple task IDs are separated by commas (,).', example='11111,22222'),
  requestId?: string(name='RequestId', description='The request ID.', example='CAAE9DDA-65FD-584C-A378-F1F24676****'),
}

model ModifyActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Modifies the switching time of scheduled O\\\\\\&M tasks for an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasksWithOptions(request: ModifyActiveOperationTasksRequest, runtime: Util.RuntimeOptions): ModifyActiveOperationTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.immediateStart)) {
    query['ImmediateStart'] = request.immediateStart;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyActiveOperationTasks',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the switching time of scheduled O\\\\\\&M tasks for an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasks(request: ModifyActiveOperationTasksRequest): ModifyActiveOperationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyActiveOperationTasksWithOptions(request, runtime);
}

model ModifyAuditLogFilterRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp12c5b040dc****'),
  filter?: string(name='Filter', description='The type of logs collected by the audit log feature of the instance. Separate multiple types with commas (,). Valid values:

*   **admin**: O\\\\&M and management operations
*   **slow**: slow query logs
*   **query**: query operations
*   **insert**: insert operations
*   **update**: update operations
*   **delete**: delete operations
*   **command**: protocol commands such as the aggregate method

This parameter is required.', example='insert,query,update,delete'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleType?: string(name='RoleType', description='The role of the node in the instance. Valid values:

*   **primary**
*   **secondary**', example='primary'),
}

model ModifyAuditLogFilterResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='E209BE2B-F264-4B9D-81F6-A5A5FB1FBF28'),
}

model ModifyAuditLogFilterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAuditLogFilterResponseBody(name='body'),
}

/**
 * @summary Queries the types of logs collected by the audit log feature of an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** or **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request ModifyAuditLogFilterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAuditLogFilterResponse
 */
async function modifyAuditLogFilterWithOptions(request: ModifyAuditLogFilterRequest, runtime: Util.RuntimeOptions): ModifyAuditLogFilterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAuditLogFilter',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the types of logs collected by the audit log feature of an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the running state when you call this operation.
 * *   This operation is applicable only to **general-purpose local-disk** or **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request ModifyAuditLogFilterRequest
 * @return ModifyAuditLogFilterResponse
 */
async function modifyAuditLogFilter(request: ModifyAuditLogFilterRequest): ModifyAuditLogFilterResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAuditLogFilterWithOptions(request, runtime);
}

model ModifyAuditPolicyRequest {
  auditLogSwitchSource?: string(name='AuditLogSwitchSource', description='The request source for the audit log feature. Set the value to **Console**.', example='Console'),
  auditStatus?: string(name='AuditStatus', description='Specifies whether to enable the audit log feature. Valid values:

*   **enable**
*   **disabled**

This parameter is required.', example='enable'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp1785659e3f****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serviceType?: string(name='ServiceType', description='The type of the audit log feature. Valid values:

*   **Trail**: free trial edition.
*   **Standard**: official edition.

> The default value is **Trail**. Starting from January 6, 2022, the official edition of the audit log feature has been launched in all regions, and the free trial edition of the feature can no longer be applied for. We recommend that you set this parameter to **Standard**.', example='Standard'),
  storagePeriod?: int32(name='StoragePeriod', description='The log retention period. Valid values: 1 to 365 days. Default value: 30 days.', example='30'),
}

model ModifyAuditPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='DC04D812-F18D-4568-9B88-F260D9590116'),
}

model ModifyAuditPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAuditPolicyResponseBody(name='body'),
}

/**
 * @summary Enables or disables the audit log feature or configures the log storage duration for an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request ModifyAuditPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAuditPolicyResponse
 */
async function modifyAuditPolicyWithOptions(request: ModifyAuditPolicyRequest, runtime: Util.RuntimeOptions): ModifyAuditPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.auditLogSwitchSource)) {
    query['AuditLogSwitchSource'] = request.auditLogSwitchSource;
  }
  if (!Util.isUnset(request.auditStatus)) {
    query['AuditStatus'] = request.auditStatus;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serviceType)) {
    query['ServiceType'] = request.serviceType;
  }
  if (!Util.isUnset(request.storagePeriod)) {
    query['StoragePeriod'] = request.storagePeriod;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAuditPolicy',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables the audit log feature or configures the log storage duration for an ApsaraDB for MongoDB instance.
 *
 * @description *   This operation is applicable only to **general-purpose local-disk** and **dedicated local-disk** instances.
 * *   You can call this operation up to 30 times per minute. To call this operation at a higher frequency, use a Logstore. For more information, see [Manage a Logstore](https://help.aliyun.com/document_detail/48990.html).
 *
 * @param request ModifyAuditPolicyRequest
 * @return ModifyAuditPolicyResponse
 */
async function modifyAuditPolicy(request: ModifyAuditPolicyRequest): ModifyAuditPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAuditPolicyWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  backupInterval?: string(name='BackupInterval', description='The frequency at which high-frequency backups are generated. Valid values:

*   **-1**: High-frequency backup is disabled.
*   **30**: High-frequency backups are generated every 30 minutes.
*   **60**: High-frequency backups are generated every 1 hour.
*   **120**: High-frequency backups are generated every 2 hours.
*   **180**: High-frequency backups are generated every 3 hours.
*   **240**: High-frequency backups are generated every 4 hours.
*   **360**: High-frequency backups are generated every 6 hours.
*   **480**: High-frequency backups are generated every 8 hours.
*   **720**: High-frequency backups are generated every 12 hours.

> 

*   If you set the **SnapshotBackupType** parameter to **Standard**, you must fix the value of this parameter to -1.

*   High-frequency backup takes effect only when you set the **SnapshotBackupType** parameter to **Flash** and this parameter to a value greater than 0.', example='-1'),
  backupRetentionPeriod?: long(name='BackupRetentionPeriod', description='The retention period of full backups.

> 

*   If your instance is created before September 10, 2021, backups are retained for seven days by default.

*   If your instance is created after September 10, 2021, backups are retained for 30 days by default.', example='30'),
  backupRetentionPolicyOnClusterDeletion?: int32(name='BackupRetentionPolicyOnClusterDeletion', description='The backup retention policy configured for the instance. Valid values:

*   0: All backup sets are immediately deleted when the instance is released.
*   1: Automatic backup is performed when the instance is released and the backup set is retained for a long period of time.
*   2: Automatic backup is performed when the instance is released and all backup sets are retained for a long period of time.

For more information, see [Retain the backup files of an ApsaraDB for MongoDB instance for a long period of time](https://help.aliyun.com/document_detail/2779111.html).', example='2'),
  crossBackupPeriod?: string(name='CrossBackupPeriod', description='The day of the week on which the cross-region backup files are retained. Valid values:

1.  Monday
2.  Tuesday
3.  Wednesday
4.  Thursday
5.  Friday
6.  Saturday
7.  Sunday

>  This parameter is required for a cross-region backup operation.

*   Separate multiple values with commas (,).

*   If you set the SnapshotBackupType parameter to Standard, the parameter value must fall within the value of the PreferredBackupPeriod parameter that specifies the standard backup period.', example='Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday'),
  crossBackupType?: string(name='CrossBackupType', description='The action performed for the cross-region backup policy. Valid values:

*   update: modifies the cross-region backup policy.
*   delete: deletes the cross-region backup policy.

>  This parameter is required for a cross-region backup operation.', example='update'),
  crossLogRetentionType?: string(name='CrossLogRetentionType', description='The retention type of the cross-region log backup files. Valid values:

*   delay: retains the cross-region backup files for a period of time.
*   never: permanently retains the cross-region backup files.

>  This parameter is required for a cross-region backup operation.', example='delay'),
  crossLogRetentionValue?: int32(name='CrossLogRetentionValue', description='The retention period of the cross-region log backup files. Valid values: 3 to 1825. Unit: day. The parameter value must be less than or equal to the value of the CrossRetentionValue parameter.

>  This parameter is required for a cross-region backup operation.', example='3'),
  crossRetentionType?: string(name='CrossRetentionType', description='The retention type of the cross-region backup files. Valid values:

*   delay: retains the cross-region backup files for a period of time.
*   never: permanently retains the cross-region backup files.

>  This parameter is required for a cross-region backup operation.', example='delay'),
  crossRetentionValue?: int32(name='CrossRetentionValue', description='The retention period of the cross-region backup files. Valid values: 3 to 1825. Unit: day.

> 

*   This parameter is required for a cross-region backup operation.

*   This parameter is required when you set the CrossRetentionType parameter to delay.', example='7'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp16cb162771****'),
  destRegion?: string(name='DestRegion', description='The region in which the backup files are retained.

>  This parameter is required for a cross-region backup operation.', example='cn-hangzhou'),
  enableBackupLog?: long(name='EnableBackupLog', description='Specifies whether to enable the log backup feature. Valid values:

*   **0** (default): The log backup feature is disabled.
*   **1**: The log backup feature is enabled.', example='0'),
  enableCrossLogBackup?: int32(name='EnableCrossLogBackup', description='Specifies whether to enable the cross-region log backup feature.

>  This parameter is required for a cross-region backup operation.

*   Valid values:1: enables the feature. The parameter value must be 1 for sharded cluster instances.

*   0: disables the feature. The parameter value must be 0 for replica set instances.', example='1'),
  highFrequencyBackupRetention?: long(name='HighFrequencyBackupRetention', description='The number of days for which high-frequency backup files are retained. Before you use this parameter, make sure that you specify the BackupInterval parameter. By default, high-frequency backup files are retained for one day.', example='1'),
  instanceType?: string(name='InstanceType', description='The instance architecture. Valid values:

*   replicate
*   sharding

> 

*   This parameter is required when you set the RestoreType parameter to 2.

*   This parameter is required when you set the RestoreType parameter to 3.', example='replicate'),
  logBackupRetentionPeriod?: long(name='LogBackupRetentionPeriod', description='The number of days for which log backups are retained. Default value: 7.

Valid values: 7 to 730.', example='7'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The day of a week when the system regularly backs up data. Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**

**

**Notice**: To ensure data security, make sure that the system backs up data at least twice a week.

>  Separate multiple values with commas (,).', example='Monday,Wednesday,Friday,Sunday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The start time of the backup. Specify the time in the ISO 8601 standard in the *HH:mm*Z-*HH:mm*Z format. The time must be in UTC.

>  The time range is 1 hour.', example='03:00Z-04:00Z'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  snapshotBackupType?: string(name='SnapshotBackupType', description='The snapshot backup type. Valid values:

*   **Flash**: single-digit second backup
*   **Standard** (default): standard backup', example='Standard'),
  srcRegion?: string(name='SrcRegion', description='The region ID of the instance.

> 

*   This parameter is required for the data restoration of a deleted instance.

*   This parameter is required for a cross-region backup operation.', example='cn-beijing'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='644A359C-B871-4DD3-97B5-ED91EF5809C2'),
}

model ModifyBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Modifies a backup policy for an ApsaraDB for MongoDB instance.
 *
 * @description The cross-region backup feature is suitable only for replica set or sharded cluster instances that use cloud disks.
 *
 * @param request ModifyBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupInterval)) {
    query['BackupInterval'] = request.backupInterval;
  }
  if (!Util.isUnset(request.backupRetentionPeriod)) {
    query['BackupRetentionPeriod'] = request.backupRetentionPeriod;
  }
  if (!Util.isUnset(request.backupRetentionPolicyOnClusterDeletion)) {
    query['BackupRetentionPolicyOnClusterDeletion'] = request.backupRetentionPolicyOnClusterDeletion;
  }
  if (!Util.isUnset(request.crossBackupPeriod)) {
    query['CrossBackupPeriod'] = request.crossBackupPeriod;
  }
  if (!Util.isUnset(request.crossBackupType)) {
    query['CrossBackupType'] = request.crossBackupType;
  }
  if (!Util.isUnset(request.crossLogRetentionType)) {
    query['CrossLogRetentionType'] = request.crossLogRetentionType;
  }
  if (!Util.isUnset(request.crossLogRetentionValue)) {
    query['CrossLogRetentionValue'] = request.crossLogRetentionValue;
  }
  if (!Util.isUnset(request.crossRetentionType)) {
    query['CrossRetentionType'] = request.crossRetentionType;
  }
  if (!Util.isUnset(request.crossRetentionValue)) {
    query['CrossRetentionValue'] = request.crossRetentionValue;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.destRegion)) {
    query['DestRegion'] = request.destRegion;
  }
  if (!Util.isUnset(request.enableBackupLog)) {
    query['EnableBackupLog'] = request.enableBackupLog;
  }
  if (!Util.isUnset(request.enableCrossLogBackup)) {
    query['EnableCrossLogBackup'] = request.enableCrossLogBackup;
  }
  if (!Util.isUnset(request.highFrequencyBackupRetention)) {
    query['HighFrequencyBackupRetention'] = request.highFrequencyBackupRetention;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.logBackupRetentionPeriod)) {
    query['LogBackupRetentionPeriod'] = request.logBackupRetentionPeriod;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.preferredBackupPeriod)) {
    query['PreferredBackupPeriod'] = request.preferredBackupPeriod;
  }
  if (!Util.isUnset(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.snapshotBackupType)) {
    query['SnapshotBackupType'] = request.snapshotBackupType;
  }
  if (!Util.isUnset(request.srcRegion)) {
    query['SrcRegion'] = request.srcRegion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyBackupPolicy',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies a backup policy for an ApsaraDB for MongoDB instance.
 *
 * @description The cross-region backup feature is suitable only for replica set or sharded cluster instances that use cloud disks.
 *
 * @param request ModifyBackupPolicyRequest
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyDBInstanceConfigRequest {
  configName?: string(name='ConfigName', description='This parameter is required.', example='manual_check'),
  configValue?: string(name='ConfigValue', description='This parameter is required.', example='0'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='dds-bp1ea17b41ab****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceConfigResponseBody = {
  requestId?: string(name='RequestId', example='E466EFD6-2AD2-xxxx-A1A6-C7AFA1B323E1'),
}

model ModifyDBInstanceConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceConfigResponseBody(name='body'),
}

/**
 * @summary 修改实例配置
 *
 * @param request ModifyDBInstanceConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceConfigResponse
 */
async function modifyDBInstanceConfigWithOptions(request: ModifyDBInstanceConfigRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configName)) {
    query['ConfigName'] = request.configName;
  }
  if (!Util.isUnset(request.configValue)) {
    query['ConfigValue'] = request.configValue;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceConfig',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 修改实例配置
 *
 * @param request ModifyDBInstanceConfigRequest
 * @return ModifyDBInstanceConfigResponse
 */
async function modifyDBInstanceConfig(request: ModifyDBInstanceConfigRequest): ModifyDBInstanceConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceConfigWithOptions(request, runtime);
}

model ModifyDBInstanceConnectionStringRequest {
  currentConnectionString?: string(name='CurrentConnectionString', description='The current endpoint that is to be modified.

This parameter is required.', example='s-bpxxxxxxxx.mongodb.rds.aliyuncs.com'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

> If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bpxxxxxxxx'),
  newConnectionString?: string(name='NewConnectionString', description='The new endpoint. It must be 8 to 64 characters in length and can contain letters and digits. It must start with a lowercase letter.

> You need only to specify the prefix of the endpoint. The content other than the prefix cannot be modified.

This parameter is required.', example='aliyuntest111'),
  newPort?: int32(name='NewPort', description='The new port number of the instance. The port number must be within the range from 1000 to 65535.

>  This parameter is available only when you set the **DBInstanceId** parameter to the ID of an instance that uses cloud disks.', example='3310'),
  nodeId?: string(name='NodeId', description='The ID of the mongos in the specified sharded cluster instance. Only one mongos ID can be specified in each call.

> This parameter is valid only when you specify the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='s-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceConnectionStringResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='FF36A84C-0694-42D0-861D-C383E8E4FAAF'),
}

model ModifyDBInstanceConnectionStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceConnectionStringResponseBody(name='body'),
}

/**
 * @summary Modifies the endpoint that is used to connect to an ApsaraDB for MongoDB instance.
 *
 * @description You can modify the connection strings and ports of the following instances:
 * *   You can modify the connection strings of instances that use local or cloud disks.
 * *   You can only modify the ports of instances that use cloud disks.
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionStringWithOptions(request: ModifyDBInstanceConnectionStringRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceConnectionStringResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.newConnectionString)) {
    query['NewConnectionString'] = request.newConnectionString;
  }
  if (!Util.isUnset(request.newPort)) {
    query['NewPort'] = request.newPort;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceConnectionString',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the endpoint that is used to connect to an ApsaraDB for MongoDB instance.
 *
 * @description You can modify the connection strings and ports of the following instances:
 * *   You can modify the connection strings of instances that use local or cloud disks.
 * *   You can only modify the ports of instances that use cloud disks.
 *
 * @param request ModifyDBInstanceConnectionStringRequest
 * @return ModifyDBInstanceConnectionStringResponse
 */
async function modifyDBInstanceConnectionString(request: ModifyDBInstanceConnectionStringRequest): ModifyDBInstanceConnectionStringResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceConnectionStringWithOptions(request, runtime);
}

model ModifyDBInstanceDescriptionRequest {
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The name of the instance.

> 

*   The name cannot start with `http://` or `https://`.

*   It must start with a letter.

*   It must be 2 to 256 characters in length, and can contain letters, underscores (_), hyphens (-), and digits.

This parameter is required.', example='testdata'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  To modify the name of a shard or mongos node in a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp2234****'),
  nodeId?: string(name='NodeId', description='The ID of the shard or mongos node in the sharded cluster instance.

>  This parameter is valid only if you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='d-bp89067****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='06F8F642-4009-4FFC-80C4-9D67DBF7B74E'),
}

model ModifyDBInstanceDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the name of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceDescriptionResponse
 */
async function modifyDBInstanceDescriptionWithOptions(request: ModifyDBInstanceDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceDescription',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the name of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceDescriptionRequest
 * @return ModifyDBInstanceDescriptionResponse
 */
async function modifyDBInstanceDescription(request: ModifyDBInstanceDescriptionRequest): ModifyDBInstanceDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDBInstanceDiskTypeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**: enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. You must perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner, click **Expenses** and select **User Center** from the drop-down list. The User Center page appears. In the left-side navigation pane, choose **Order Management** > Renew. On the Renewal tab, find the bill that you want to pay and then click Renew in the Actions column.

Default value: **true**.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false**

Default value: **false**.', example='false'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp1fa5efaa93****'),
  dbInstanceStorageType?: string(name='DbInstanceStorageType', description='The new disk type. Valid values:

*   **cloud_auto**: ESSD AutoPL disk
*   **cloud_essd1**: PL1 ESSD
*   **cloud_essd2**: PL2 ESSD
*   **cloud_essd3**: PL3 ESSD', example='cloud_auto'),
  extraParam?: string(name='ExtraParam', description='An additional parameter.', example='async'),
  orderType?: string(name='OrderType', description='The type of configuration changes. Valid values:

*   **UPGRADE**
*   **DOWNGRADE**

>  This parameter is valid only when the billing method of the instance is subscription.', example='UPGRADE'),
  provisionedIops?: long(name='ProvisionedIops', description='The provisioned IOPS. Valid values: 0 to 50000.', example='1960'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceDiskTypeResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='21012719476****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D8F1D721-6439-4257-A89C-F1E8E9C9****'),
}

model ModifyDBInstanceDiskTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceDiskTypeResponseBody(name='body'),
}

/**
 * @summary Modifies the disk type of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceDiskTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceDiskTypeResponse
 */
async function modifyDBInstanceDiskTypeWithOptions(request: ModifyDBInstanceDiskTypeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceDiskTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.dbInstanceStorageType)) {
    query['DbInstanceStorageType'] = request.dbInstanceStorageType;
  }
  if (!Util.isUnset(request.extraParam)) {
    query['ExtraParam'] = request.extraParam;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.provisionedIops)) {
    query['ProvisionedIops'] = request.provisionedIops;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceDiskType',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the disk type of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceDiskTypeRequest
 * @return ModifyDBInstanceDiskTypeResponse
 */
async function modifyDBInstanceDiskType(request: ModifyDBInstanceDiskTypeRequest): ModifyDBInstanceDiskTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceDiskTypeWithOptions(request, runtime);
}

model ModifyDBInstanceMaintainTimeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpac2345****'),
  maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window. Specify the time in the ISO 8601 standard in the *HH:mm*Z format. The time must be in UTC.

>  The end time must be later than the start time of the maintenance window.

This parameter is required.', example='02:00Z'),
  maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window. Specify the time in the ISO 8601 standard in the *HH:mm*Z format. The time must be in UTC.

This parameter is required.', example='01:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceMaintainTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A9310426-C763-42A2-A3AD-70A8DA204531'),
}

model ModifyDBInstanceMaintainTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceMaintainTimeResponseBody(name='body'),
}

/**
 * @summary Modifies the maintenance window of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceMaintainTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceMaintainTimeResponse
 */
async function modifyDBInstanceMaintainTimeWithOptions(request: ModifyDBInstanceMaintainTimeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceMaintainTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.maintainEndTime)) {
    query['MaintainEndTime'] = request.maintainEndTime;
  }
  if (!Util.isUnset(request.maintainStartTime)) {
    query['MaintainStartTime'] = request.maintainStartTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceMaintainTime',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the maintenance window of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyDBInstanceMaintainTimeRequest
 * @return ModifyDBInstanceMaintainTimeResponse
 */
async function modifyDBInstanceMaintainTime(request: ModifyDBInstanceMaintainTimeRequest): ModifyDBInstanceMaintainTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceMaintainTimeWithOptions(request, runtime);
}

model ModifyDBInstanceMonitorRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  granularity?: string(name='Granularity', description='The collection frequency of monitoring data. Valid values: **1** or **300**. Unit: seconds.

This parameter is required.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceMonitorResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EFD65226-08CC-4C4D-B6A4-CB3C382F67B0'),
}

model ModifyDBInstanceMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceMonitorResponseBody(name='body'),
}

/**
 * @summary You can call this operation to set the monitoring granularity for an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation is applicable only to the ApsaraDB for MongoDB console of the previous version due to the change in the feature of adjusting collection intervals of monitoring data.
 * Before you call this operation, make sure that the following requirements are met:
 * *   A replica set or sharded cluster instance is used.
 * *   MongoDB 3.4 (the latest minor version) or MongoDB 4.0 is selected.
 *
 * @param request ModifyDBInstanceMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceMonitorResponse
 */
async function modifyDBInstanceMonitorWithOptions(request: ModifyDBInstanceMonitorRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.granularity)) {
    query['Granularity'] = request.granularity;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceMonitor',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to set the monitoring granularity for an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation is applicable only to the ApsaraDB for MongoDB console of the previous version due to the change in the feature of adjusting collection intervals of monitoring data.
 * Before you call this operation, make sure that the following requirements are met:
 * *   A replica set or sharded cluster instance is used.
 * *   MongoDB 3.4 (the latest minor version) or MongoDB 4.0 is selected.
 *
 * @param request ModifyDBInstanceMonitorRequest
 * @return ModifyDBInstanceMonitorResponse
 */
async function modifyDBInstanceMonitor(request: ModifyDBInstanceMonitorRequest): ModifyDBInstanceMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceMonitorWithOptions(request, runtime);
}

model ModifyDBInstanceNetExpireTimeRequest {
  classicExpendExpiredDays?: int32(name='ClassicExpendExpiredDays', description='The retention period of the classic network endpoint of the instance. Valid values: **14**, **30**, **60**, and **120**. Unit: day.

This parameter is required.', example='30'),
  connectionString?: string(name='ConnectionString', description='The endpoint of the instance.', example='dds-bpxxxxxxxx.mongodb.rds.aliyuncs.com'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceNetExpireTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='459E7D5C-38DA-4E14-9C82-5B5AF693DBAB'),
}

model ModifyDBInstanceNetExpireTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceNetExpireTimeResponseBody(name='body'),
}

/**
 * @summary Extends the retention period of the classic network endpoint of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   The network of the instance is in hybrid access mode.
 * >  This operation is supported by replica set instances and sharded cluster instances. This operation is not supported by standalone instances.
 *
 * @param request ModifyDBInstanceNetExpireTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceNetExpireTimeResponse
 */
async function modifyDBInstanceNetExpireTimeWithOptions(request: ModifyDBInstanceNetExpireTimeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceNetExpireTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classicExpendExpiredDays)) {
    query['ClassicExpendExpiredDays'] = request.classicExpendExpiredDays;
  }
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceNetExpireTime',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Extends the retention period of the classic network endpoint of an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   The network of the instance is in hybrid access mode.
 * >  This operation is supported by replica set instances and sharded cluster instances. This operation is not supported by standalone instances.
 *
 * @param request ModifyDBInstanceNetExpireTimeRequest
 * @return ModifyDBInstanceNetExpireTimeResponse
 */
async function modifyDBInstanceNetExpireTime(request: ModifyDBInstanceNetExpireTimeRequest): ModifyDBInstanceNetExpireTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceNetExpireTimeWithOptions(request, runtime);
}

model ModifyDBInstanceNetworkTypeRequest {
  classicExpiredDays?: int32(name='ClassicExpiredDays', description='The retention period of the original classic network address when you change the network type to VPC. Valid values: **14**, **30**, **60**, and **120**. Unit: days.

> This parameter is required when the **NetworkType** parameter is set to **VPC** and the **RetainClassic** parameter is set to **True**.', example='30'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp11483712c1****'),
  networkType?: string(name='NetworkType', description='The network type to switch to. Valid value:

*   **VPC**

This parameter is required.', example='VPC'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  retainClassic?: string(name='RetainClassic', description='Specifies whether to retain the original classic network address when you change the network type to VPC. Valid values:

*   **True**: retains the original classic network address.
*   **False**: does not retain the original classic network address.

> 

*   This parameter is required when the **NetworkType** parameter is set to **VPC**.

*   If you set this parameter to **True**, you must also specify the **ClassicExpiredDays** parameter.', example='False'),
  vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the VPC.

> This parameter is required when the **NetworkType** parameter is set to **VPC**.', example='vsw-bp1vj604nj5a9zz74****'),
  vpcId?: string(name='VpcId', description='The ID of the VPC.

> This parameter is required when the **NetworkType** parameter is set to **VPC**.', example='vpc-bp1n3i15v90el48nx****'),
  zoneId?: string(name='ZoneId', description='可用区ID，您可以通过调用[DescribeRegions](https://help.aliyun.com/document_detail/61933.html)接口查询可用区ID。

This parameter is required.', example='cn-hangzhou-b'),
}

model ModifyDBInstanceNetworkTypeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D0E605FD-6ECE-5FBE-84A4-99AAB1B8****'),
}

model ModifyDBInstanceNetworkTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceNetworkTypeResponseBody(name='body'),
}

/**
 * @summary Changes the network type of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances, but not standalone instances. You can call this operation to change the network of an instance from a classic network to a VPC.
 *
 * @param request ModifyDBInstanceNetworkTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceNetworkTypeResponse
 */
async function modifyDBInstanceNetworkTypeWithOptions(request: ModifyDBInstanceNetworkTypeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceNetworkTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.classicExpiredDays)) {
    query['ClassicExpiredDays'] = request.classicExpiredDays;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.retainClassic)) {
    query['RetainClassic'] = request.retainClassic;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceNetworkType',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the network type of an ApsaraDB for MongoDB instance.
 *
 * @description This operation is applicable to replica set instances and sharded cluster instances, but not standalone instances. You can call this operation to change the network of an instance from a classic network to a VPC.
 *
 * @param request ModifyDBInstanceNetworkTypeRequest
 * @return ModifyDBInstanceNetworkTypeResponse
 */
async function modifyDBInstanceNetworkType(request: ModifyDBInstanceNetworkTypeRequest): ModifyDBInstanceNetworkTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceNetworkTypeWithOptions(request, runtime);
}

model ModifyDBInstanceSSLRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp2235****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  SSLAction?: string(name='SSLAction', description='The operation on the SSL feature. Valid values:

*   **Open**: enables SSL encryption.
*   **Close**: disables SSL encryption.
*   **Update**: updates the SSL certificate.

This parameter is required.', example='Open'),
}

model ModifyDBInstanceSSLResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='6D806B11-078F-4154-BF9F-844F56D08964'),
}

model ModifyDBInstanceSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceSSLResponseBody(name='body'),
}

/**
 * @summary Modifies the SSL settings of an ApsaraDB for MongoDB instance.
 *
 * @description ## Usage
 * Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the running state.
 * *   The instance is a replica set instance.
 * *   The engine version of the instance is 3.4 or 4.0.
 * >  When you enable or disable SSL encryption or update the SSL certificate, the instance restarts. We recommend that you call this operation during off-peak hours.
 *
 * @param request ModifyDBInstanceSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceSSLResponse
 */
async function modifyDBInstanceSSLWithOptions(request: ModifyDBInstanceSSLRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceSSLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.SSLAction)) {
    query['SSLAction'] = request.SSLAction;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceSSL',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the SSL settings of an ApsaraDB for MongoDB instance.
 *
 * @description ## Usage
 * Before you call this operation, make sure that the following requirements are met:
 * *   The instance is in the running state.
 * *   The instance is a replica set instance.
 * *   The engine version of the instance is 3.4 or 4.0.
 * >  When you enable or disable SSL encryption or update the SSL certificate, the instance restarts. We recommend that you call this operation during off-peak hours.
 *
 * @param request ModifyDBInstanceSSLRequest
 * @return ModifyDBInstanceSSLResponse
 */
async function modifyDBInstanceSSL(request: ModifyDBInstanceSSLRequest): ModifyDBInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceSSLWithOptions(request, runtime);
}

model ModifyDBInstanceSpecRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true** (default): enables automatic payment. Make sure that your Alibaba Cloud account has a sufficient balance.
*   **false**: disables automatic payment. You can perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, choose **Expenses** > **User Center**. In the left-side navigation pane, choose **Order Management** > **Order**. On the **Orders for Services** tab, find the order and pay for the order.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information.', example='{“ActivityId":"000000000"}'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The instance type. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html). You can also call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/149719.html) operation to view instance types.

> You must specify at least one of the DBInstanceClass and **DBInstanceStorage** parameters.', example='dds.sn4.xlarge.1'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp1ea17b41ab****'),
  DBInstanceStorage?: string(name='DBInstanceStorage', description='The storage capacity of the instance. Valid values: 10 to 3000. The value must be a multiple of 10. Unit: GB. The values that can be specified for this parameter are subject to the instance types. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html).

> 

*   You must specify at least one of the DBInstanceStorage and **DBInstanceClass** parameters.

*   Storage capacity can be scaled down only for pay-as-you-go replica set instances. The new storage capacity you specify must be greater than the used storage capacity.', example='50'),
  effectiveTime?: string(name='EffectiveTime', description='The time when the changed configurations take effect. Valid values:

*   **Immediately** (default): The configurations immediately take effect.
*   **MaintainTime**: The configurations take effect during the maintenance window of the instance.', example='Immediately'),
  extraParam?: string(name='ExtraParam', description='The additional parameter.

Valid values:

*   async

    <!-- -->

    <!-- -->

    <!-- -->

*   sync

    <!-- -->

    <!-- -->

    <!-- -->', example='async'),
  orderType?: string(name='OrderType', description='The type of the configuration change. Valid values:

*   **UPGRADE**
*   **DOWNGRADE** (default)

>  This parameter can be configured only when the billing method of the instance is subscription.', example='UPGRADE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readonlyReplicas?: string(name='ReadonlyReplicas', description='The number of read-only nodes. Valid values: **0** to **5**.

If your instance has only **Classic Network** and **VPC** endpoints, you must apply for a public endpoint or release the classic network endpoint for the instance before you can change the **Read-only Nodes** value.

> You can go to the **Database Connections** page to view the types of networks that are enabled.', example='1'),
  replicationFactor?: string(name='ReplicationFactor', description='The number of nodes in the instance.

*   Valid values for replica set instances: **3**, **5**, and **7**
*   Valid values for standalone instances: **1**

>  This parameter is not required for a serverless instance which is only available on the China site (aliyun.com).', example='3'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceSpecResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='21012408824****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1E9F1104-19E7-59F0-AB7F-F4EBFDEA****'),
}

model ModifyDBInstanceSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceSpecResponseBody(name='body'),
}

/**
 * @summary Modifies the specifications or storage space of an ApsaraDB for MongoDB standalone, replica set, or serverless instance. Serverless instances are available only on the China site (aliyun.com).
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * This operation applies only to standalone and replica set instances. To modify the specifications of sharded cluster instances, you can call the [ModifyNodeSpec](https://help.aliyun.com/document_detail/61911.html), [CreateNode](https://help.aliyun.com/document_detail/61922.html), [DeleteNode](https://help.aliyun.com/document_detail/61816.html), or [ModifyNodeSpecBatch](https://help.aliyun.com/document_detail/61923.html) operation.
 *
 * @param request ModifyDBInstanceSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceSpecResponse
 */
async function modifyDBInstanceSpecWithOptions(request: ModifyDBInstanceSpecRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceSpecResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.DBInstanceStorage)) {
    query['DBInstanceStorage'] = request.DBInstanceStorage;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.extraParam)) {
    query['ExtraParam'] = request.extraParam;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.readonlyReplicas)) {
    query['ReadonlyReplicas'] = request.readonlyReplicas;
  }
  if (!Util.isUnset(request.replicationFactor)) {
    query['ReplicationFactor'] = request.replicationFactor;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceSpec',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the specifications or storage space of an ApsaraDB for MongoDB standalone, replica set, or serverless instance. Serverless instances are available only on the China site (aliyun.com).
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * This operation applies only to standalone and replica set instances. To modify the specifications of sharded cluster instances, you can call the [ModifyNodeSpec](https://help.aliyun.com/document_detail/61911.html), [CreateNode](https://help.aliyun.com/document_detail/61922.html), [DeleteNode](https://help.aliyun.com/document_detail/61816.html), or [ModifyNodeSpecBatch](https://help.aliyun.com/document_detail/61923.html) operation.
 *
 * @param request ModifyDBInstanceSpecRequest
 * @return ModifyDBInstanceSpecResponse
 */
async function modifyDBInstanceSpec(request: ModifyDBInstanceSpecRequest): ModifyDBInstanceSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceSpecWithOptions(request, runtime);
}

model ModifyDBInstanceTDERequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  encryptionKey?: string(name='EncryptionKey', description='The ID of the custom key.', example='749c1df7-xxxx-xxxx-xxxx-xxxxxxxxxxxx'),
  encryptorName?: string(name='EncryptorName', description='The encryption method. Set the value to **aes-256-cbc**.

> This parameter is valid only when the **TEDStatus** parameter is set to **enabled**.', example='aes-256-cbc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleARN?: string(name='RoleARN', description='The Alibaba Cloud Resource Name (ARN) of the specified Resource Access Management (RAM) role. The ARN is displayed in the `acs:ram::$accountID:role/$roleName` format.

> *   `$accountID`: specifies the ID of the Alibaba Cloud account. To view the account ID, log on to the Alibaba Cloud Management Console, move your pointer over your profile picture in the upper-right corner, and then click Security Settings.

> *   `$roleName`: specifies the name of the RAM role. To view the RAM role name, log on to the RAM console. In the left-side navigation pane, choose Identities > Roles. On the Roles page, view the name of the RAM role.', example='acs:ram::123456789012****:role/adminrole'),
  TDEStatus?: string(name='TDEStatus', description='The TDE status. When the value of this parameter is set to **Enabled**, TDE is enabled.

> You cannot disable TDE after it is enabled. Proceed with caution.

This parameter is required.', example='enabled'),
}

model ModifyDBInstanceTDEResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='434D7127-6229-4355-BA50-7A3685A725DF'),
}

model ModifyDBInstanceTDEResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceTDEResponseBody(name='body'),
}

/**
 * @summary Modifies the transparent data encryption (TDE) status of an ApsaraDB for MongoDB instance.
 *
 * @description TDE allows you to perform real-time I/O encryption and decryption on data files. Data is encrypted before it is written to a disk and is decrypted when it is read from the disk to the memory. For more information, see [Configure TDE](https://help.aliyun.com/document_detail/131048.html).
 * >  TDE cannot be disabled after it is enabled.
 * Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   A replica set or sharded cluster instance is used.
 * *   The storage engine of the instance is WiredTiger.
 * *   The instance uses local disks to store data.
 * *   The database engine version of the instance is 4.0 or 4.2. If the database engine version is earlier than 4.0, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine.
 *
 * @param request ModifyDBInstanceTDERequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceTDEResponse
 */
async function modifyDBInstanceTDEWithOptions(request: ModifyDBInstanceTDERequest, runtime: Util.RuntimeOptions): ModifyDBInstanceTDEResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.encryptionKey)) {
    query['EncryptionKey'] = request.encryptionKey;
  }
  if (!Util.isUnset(request.encryptorName)) {
    query['EncryptorName'] = request.encryptorName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleARN)) {
    query['RoleARN'] = request.roleARN;
  }
  if (!Util.isUnset(request.TDEStatus)) {
    query['TDEStatus'] = request.TDEStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceTDE',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the transparent data encryption (TDE) status of an ApsaraDB for MongoDB instance.
 *
 * @description TDE allows you to perform real-time I/O encryption and decryption on data files. Data is encrypted before it is written to a disk and is decrypted when it is read from the disk to the memory. For more information, see [Configure TDE](https://help.aliyun.com/document_detail/131048.html).
 * >  TDE cannot be disabled after it is enabled.
 * Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   A replica set or sharded cluster instance is used.
 * *   The storage engine of the instance is WiredTiger.
 * *   The instance uses local disks to store data.
 * *   The database engine version of the instance is 4.0 or 4.2. If the database engine version is earlier than 4.0, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine.
 *
 * @param request ModifyDBInstanceTDERequest
 * @return ModifyDBInstanceTDEResponse
 */
async function modifyDBInstanceTDE(request: ModifyDBInstanceTDERequest): ModifyDBInstanceTDEResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceTDEWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupRequest {
  GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

> Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP address whitelists.

This parameter is required.', example='27.16.214.10,111.60.117.181'),
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.

This parameter is required.', example='dps'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-fwjk62egbsrp4sftxmmr'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyGlobalSecurityIPGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A0181AC4-F186-46ED-87CA-100C70B86729'),
}

model ModifyGlobalSecurityIPGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the global IP whitelist template associated with an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupResponse
 */
async function modifyGlobalSecurityIPGroupWithOptions(request: ModifyGlobalSecurityIPGroupRequest, runtime: Util.RuntimeOptions): ModifyGlobalSecurityIPGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.GIpList)) {
    query['GIpList'] = request.GIpList;
  }
  if (!Util.isUnset(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!Util.isUnset(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyGlobalSecurityIPGroup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the global IP whitelist template associated with an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupRequest
 * @return ModifyGlobalSecurityIPGroupResponse
 */
async function modifyGlobalSecurityIPGroup(request: ModifyGlobalSecurityIPGroupRequest): ModifyGlobalSecurityIPGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyGlobalSecurityIPGroupWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupNameRequest {
  globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template. The name must meet the following requirements:

*   It can contain lowercase letters, digits, and underscores (_).
*   It must start with a letter and end with a letter or digit.
*   It must be 2 to 120 characters in length.

This parameter is required.', example='prod_baoxian_k8s'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-xmtncwkrzqqoe59dzljb'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyGlobalSecurityIPGroupNameResponseBody = {
  globalSecurityIPGroup?: [ 
    {
      GIpList?: string(name='GIpList', description='The IP addresses in the whitelist template.

> Separate multiple IP addresses with commas (,). You can create up to 1,000 IP addresses or CIDR blocks for all IP address whitelists.', example='222.70.197.187'),
      globalIgName?: string(name='GlobalIgName', description='The name of the IP whitelist template.', example='def'),
      globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.', example='g-qiawi8ec1urcx9swoy37'),
      regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-shanghai'),
    }
  ](name='GlobalSecurityIPGroup', description='The global IP whitelist templates.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8CA8312-530A-413A-9129-F2BB32A8D404'),
}

model ModifyGlobalSecurityIPGroupNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupNameResponseBody(name='body'),
}

/**
 * @summary Modifies the name of a global IP whitelist template associated with an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupNameResponse
 */
async function modifyGlobalSecurityIPGroupNameWithOptions(request: ModifyGlobalSecurityIPGroupNameRequest, runtime: Util.RuntimeOptions): ModifyGlobalSecurityIPGroupNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.globalIgName)) {
    query['GlobalIgName'] = request.globalIgName;
  }
  if (!Util.isUnset(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyGlobalSecurityIPGroupName',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the name of a global IP whitelist template associated with an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupNameRequest
 * @return ModifyGlobalSecurityIPGroupNameResponse
 */
async function modifyGlobalSecurityIPGroupName(request: ModifyGlobalSecurityIPGroupNameRequest): ModifyGlobalSecurityIPGroupNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyGlobalSecurityIPGroupNameWithOptions(request, runtime);
}

model ModifyGlobalSecurityIPGroupRelationRequest {
  DBClusterId?: string(name='DBClusterId', description='The instance ID.

This parameter is required.', example='dds-2ze6069764423m0l'),
  globalSecurityGroupId?: string(name='GlobalSecurityGroupId', description='The ID of the IP whitelist template.

This parameter is required.', example='g-u0qdtybfvxhaxrrhk4n7'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyGlobalSecurityIPGroupRelationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='52820D2B-B2DD-59F0-BDF2-83EC19C6F1CA'),
}

model ModifyGlobalSecurityIPGroupRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGlobalSecurityIPGroupRelationResponseBody(name='body'),
}

/**
 * @summary Modifies the mapping between a global whitelist template and an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupRelationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGlobalSecurityIPGroupRelationResponse
 */
async function modifyGlobalSecurityIPGroupRelationWithOptions(request: ModifyGlobalSecurityIPGroupRelationRequest, runtime: Util.RuntimeOptions): ModifyGlobalSecurityIPGroupRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.globalSecurityGroupId)) {
    query['GlobalSecurityGroupId'] = request.globalSecurityGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyGlobalSecurityIPGroupRelation',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the mapping between a global whitelist template and an ApsaraDB for MongoDB instance.
 *
 * @param request ModifyGlobalSecurityIPGroupRelationRequest
 * @return ModifyGlobalSecurityIPGroupRelationResponse
 */
async function modifyGlobalSecurityIPGroupRelation(request: ModifyGlobalSecurityIPGroupRelationRequest): ModifyGlobalSecurityIPGroupRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyGlobalSecurityIPGroupRelationWithOptions(request, runtime);
}

model ModifyInstanceAutoRenewalAttributeRequest {
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false**

>  If this parameter is set to **true**, you must set the **Duration** parameter.

This parameter is required.', example='true'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp15da1923e3****'),
  duration?: string(name='Duration', description='The auto-renewal period. Valid values: **1** to **12**. Unit: month.

>  This parameter is valid only when **AutoRenew** is set to **true**.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyInstanceAutoRenewalAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='EFD65226-08CC-4C4D-B6A4-CB3C382F67B0'),
}

model ModifyInstanceAutoRenewalAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceAutoRenewalAttributeResponseBody(name='body'),
}

/**
 * @summary Enables or disables auto-renewal for an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * This operation is applicable to subscription instances.
 * >  When auto-renewal is enabled, your payment will be collected nine days before the expiration date of ApsaraDB for MongoDB. Ensure that your account has sufficient balance.
 *
 * @param request ModifyInstanceAutoRenewalAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceAutoRenewalAttributeResponse
 */
async function modifyInstanceAutoRenewalAttributeWithOptions(request: ModifyInstanceAutoRenewalAttributeRequest, runtime: Util.RuntimeOptions): ModifyInstanceAutoRenewalAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceAutoRenewalAttribute',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables auto-renewal for an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * This operation is applicable to subscription instances.
 * >  When auto-renewal is enabled, your payment will be collected nine days before the expiration date of ApsaraDB for MongoDB. Ensure that your account has sufficient balance.
 *
 * @param request ModifyInstanceAutoRenewalAttributeRequest
 * @return ModifyInstanceAutoRenewalAttributeResponse
 */
async function modifyInstanceAutoRenewalAttribute(request: ModifyInstanceAutoRenewalAttributeRequest): ModifyInstanceAutoRenewalAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceAutoRenewalAttributeWithOptions(request, runtime);
}

model ModifyInstanceVpcAuthModeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the mongos node in the sharded cluster instance.

>  This parameter can be used only when the instance type is sharded cluster.', example='s-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  vpcAuthMode?: string(name='VpcAuthMode', description='Specify whether to disable password-free access over VPC. Set the value to **Close**.', example='Open'),
}

model ModifyInstanceVpcAuthModeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='BA51E9D9-B14A-4542-B6E6-7DE00BECCB8C'),
}

model ModifyInstanceVpcAuthModeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyInstanceVpcAuthModeResponseBody(name='body'),
}

/**
 * @summary Disables password-free access over Virtual Private Cloud (VPC) for an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The database engine version of the instance is 4.0 (with the minor version of mongodb_20190408_3.0.11 or later) or 4.2. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the database engine version of the instance. If necessary, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine version of the instance.
 * *   The network type of the instance must be VPC. If the network type of the instance is classic network, you must call the [ModifyDBInstanceNetworkType](https://help.aliyun.com/document_detail/62138.html) operation to change the network type to VPC.
 * *   You can only disable but not enable password-free access over VPC.
 *
 * @param request ModifyInstanceVpcAuthModeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyInstanceVpcAuthModeResponse
 */
async function modifyInstanceVpcAuthModeWithOptions(request: ModifyInstanceVpcAuthModeRequest, runtime: Util.RuntimeOptions): ModifyInstanceVpcAuthModeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.vpcAuthMode)) {
    query['VpcAuthMode'] = request.vpcAuthMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyInstanceVpcAuthMode',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disables password-free access over Virtual Private Cloud (VPC) for an ApsaraDB for MongoDB instance.
 *
 * @description Before you call this operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is a replica set or sharded cluster instance.
 * *   The database engine version of the instance is 4.0 (with the minor version of mongodb_20190408_3.0.11 or later) or 4.2. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the database engine version of the instance. If necessary, you can call the [UpgradeDBInstanceEngineVersion](https://help.aliyun.com/document_detail/67608.html) operation to upgrade the database engine version of the instance.
 * *   The network type of the instance must be VPC. If the network type of the instance is classic network, you must call the [ModifyDBInstanceNetworkType](https://help.aliyun.com/document_detail/62138.html) operation to change the network type to VPC.
 * *   You can only disable but not enable password-free access over VPC.
 *
 * @param request ModifyInstanceVpcAuthModeRequest
 * @return ModifyInstanceVpcAuthModeResponse
 */
async function modifyInstanceVpcAuthMode(request: ModifyInstanceVpcAuthModeRequest): ModifyInstanceVpcAuthModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyInstanceVpcAuthModeWithOptions(request, runtime);
}

model ModifyNodeSpecRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true** (default): enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. In this case, you must manually pay for the instance.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp1c0b990184****'),
  effectiveTime?: string(name='EffectiveTime', description='The time when the changed configurations take effect. Valid values:

*   **Immediately** (default): The new configurations immediately take effect
*   **MaintainTime**: The new configurations take effect during the maintenance window of the instance.', example='Immediately'),
  fromApp?: string(name='FromApp', description='The source of the request. Valid values:

*   **OpenApi**: the ApsaraDB for MongoDB API
*   **mongo_buy**: the ApsaraDB for MongoDB console', example='OpenApi'),
  nodeClass?: string(name='NodeClass', description='The specifications of the shard or mongos node. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html).', example='dds.mongos.standard'),
  nodeId?: string(name='NodeId', description='The ID of the shard or mongos node in the sharded cluster instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the node ID.

> If you set this parameter to the ID of the shard node, you must also specify the **NodeStorage** parameter.

This parameter is required.', example='s-bp143e1b1637****'),
  nodeStorage?: int32(name='NodeStorage', description='The storage capacity of the shard node. Unit: GB.

*   Valid values are **10** to **2000** if the instance uses local SSDs.
*   Valid values are **20** to **16000** if the instance uses enhanced SSDs (ESSDs) at PL1.

> The value must be a multiple of 10.', example='20'),
  orderType?: string(name='OrderType', description='The order type. Valid values:

*   **UPGRADE**
*   **DOWNGRADE**', example='UPGRADE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  readonlyReplicas?: int32(name='ReadonlyReplicas', description='The number of read-only nodes in the shard node.

Valid values: **0** to **5**. The value must be an integer. Default value: **0**.', example='5'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTime?: string(name='SwitchTime', description='The execution time. Specify the time in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time must be in UTC.', example='2022-01-05T03:18:53Z'),
}

model ModifyNodeSpecResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='21084641369****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='61B05CCF-EBAB-4BF3-BA67-D77256A721E2'),
}

model ModifyNodeSpecResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyNodeSpecResponseBody(name='body'),
}

/**
 * @summary Changes the specifications and storage capacity of a node of an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * > This operation is applicable only to sharded cluster instances.
 *
 * @param request ModifyNodeSpecRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyNodeSpecResponse
 */
async function modifyNodeSpecWithOptions(request: ModifyNodeSpecRequest, runtime: Util.RuntimeOptions): ModifyNodeSpecResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.fromApp)) {
    query['FromApp'] = request.fromApp;
  }
  if (!Util.isUnset(request.nodeClass)) {
    query['NodeClass'] = request.nodeClass;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.nodeStorage)) {
    query['NodeStorage'] = request.nodeStorage;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.readonlyReplicas)) {
    query['ReadonlyReplicas'] = request.readonlyReplicas;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyNodeSpec',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the specifications and storage capacity of a node of an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB.
 * > This operation is applicable only to sharded cluster instances.
 *
 * @param request ModifyNodeSpecRequest
 * @return ModifyNodeSpecResponse
 */
async function modifyNodeSpec(request: ModifyNodeSpecRequest): ModifyNodeSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyNodeSpecWithOptions(request, runtime);
}

model ModifyNodeSpecBatchRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**: enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. You can perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, click **Expenses** to go to the **Billing Management** console. In the left-side navigation pane, click **Orders**. On the **Orders** page, find the order and complete the payment.

Default value: **true**.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information.', example='{“ActivityId":"000000000"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCz****'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance whose configurations you want to change.

This parameter is required.', example='dds-bp1337621e8f****'),
  effectiveTime?: string(name='EffectiveTime', description='The time when the changed configurations take effect. Valid values:

*   **Immediately**: The configurations immediately take effect.
*   **MaintainTime**: The configurations take effect during the maintenance window of the instance.

> 

*   You can call the [ModifyDBInstanceMaintainTime](https://help.aliyun.com/document_detail/62008.html) operation to modify the maintenance window of an instance.

*   You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the maintenance window of an instance.

Default value: **Immediately**.', example='Immediately'),
  nodesInfo?: string(name='NodesInfo', description='The configuration information of the mongos nodes or shard nodes whose configurations you want to change. For more information, see [Instance types](https://help.aliyun.com/document_detail/57141.html).

This parameter is required.', example='{"Shards":[{"DBInstanceClass":"dds.shard.mid","DBInstanceName":"d-bp14ae4572fd****","Storage":20},{"DBInstanceClass":"dds.shard.mid","DBInstanceName":"d-bp19f4f92dc5****","Storage":30}]}'),
  orderType?: string(name='OrderType', description='The type of configuration changes. Valid values:

*   **UPGRADE**
*   **DOWNGRADE**

> This parameter is only applicable to instances whose billing method is subscription.', example='UPGRADE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyNodeSpecBatchResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='21012719476****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0637BC25-6895-5500-871F-1127CA34****'),
}

model ModifyNodeSpecBatchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyNodeSpecBatchResponseBody(name='body'),
}

/**
 * @summary Changes the configurations of mongos or shard nodes in an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * This operation is applicable only to sharded cluster instances.
 * When you upgrade or downgrade the configurations of multiple sharded cluster instances in batches, the specifications of the instances are limited. For example, if you want to expand the storage capacity of the instances, the storage capacity of the instances after expansion must be greater than the current capacity. When the specifications of multiple sharded cluster instances are different, limits are defined based on the specifications of a random sharded cluster instance. In this case, you may be unable to upgrade or downgrade the configurations of the instances. In this case, we recommend that you call the ModifyNodeSpec operation to individually change the configurations of each sharded cluster instance.
 *
 * @param request ModifyNodeSpecBatchRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyNodeSpecBatchResponse
 */
async function modifyNodeSpecBatchWithOptions(request: ModifyNodeSpecBatchRequest, runtime: Util.RuntimeOptions): ModifyNodeSpecBatchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.nodesInfo)) {
    query['NodesInfo'] = request.nodesInfo;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyNodeSpecBatch',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the configurations of mongos or shard nodes in an ApsaraDB for MongoDB sharded cluster instance.
 *
 * @description Make sure that you fully understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB before you call this operation.
 * This operation is applicable only to sharded cluster instances.
 * When you upgrade or downgrade the configurations of multiple sharded cluster instances in batches, the specifications of the instances are limited. For example, if you want to expand the storage capacity of the instances, the storage capacity of the instances after expansion must be greater than the current capacity. When the specifications of multiple sharded cluster instances are different, limits are defined based on the specifications of a random sharded cluster instance. In this case, you may be unable to upgrade or downgrade the configurations of the instances. In this case, we recommend that you call the ModifyNodeSpec operation to individually change the configurations of each sharded cluster instance.
 *
 * @param request ModifyNodeSpecBatchRequest
 * @return ModifyNodeSpecBatchResponse
 */
async function modifyNodeSpecBatch(request: ModifyNodeSpecBatchRequest): ModifyNodeSpecBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyNodeSpecBatchWithOptions(request, runtime);
}

model ModifyParametersRequest {
  characterType?: string(name='CharacterType', description='The role of the instance. Valid values:

*   **db**: a shard node.
*   **cs**: a Configserver node.
*   **mongos**: a mongos node.', example='db'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the NodeId parameter.

This parameter is required.', example='dds-bp19f409d75****'),
  nodeId?: string(name='NodeId', description='The ID of the mongos or shard node in the specified sharded cluster instance.

>  This parameter is valid only when DBInstanceId is set to the ID of a sharded cluster instance.', example='d-bp1b7bb3bbe****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  parameters?: string(name='Parameters', description='The instance parameters that you want to modify and their values. Specify this parameter in a JSON string. Sample format: {"ParameterName1":"ParameterValue1","ParameterName2":"ParameterValue2"}.

>  You can call the [DescribeParameterTemplates](https://help.aliyun.com/document_detail/67618.html) operation to query a list of default parameter templates.

This parameter is required.', example='{"operationProfiling.mode":"all","operationProfiling.slowOpThresholdMs":"200"}'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyParametersResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='36923CC2-DDAB-4B48-A144-DA92C1E19537'),
}

model ModifyParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyParametersResponseBody(name='body'),
}

/**
 * @summary Modifies the parameters of an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the Running state when you call this operation.
 * *   If you call this operation to modify specific instance parameters and the modification for part of the parameters can take effect only after an instance restart, the instance is automatically restarted after this operation is called. You can call the [DescribeParameterTemplates](https://help.aliyun.com/document_detail/67618.html) operation to query the parameters that take effect only after the instance is restarted.
 *
 * @param request ModifyParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyParametersResponse
 */
async function modifyParametersWithOptions(request: ModifyParametersRequest, runtime: Util.RuntimeOptions): ModifyParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyParameters',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the parameters of an ApsaraDB for MongoDB instance.
 *
 * @description *   The instance must be in the Running state when you call this operation.
 * *   If you call this operation to modify specific instance parameters and the modification for part of the parameters can take effect only after an instance restart, the instance is automatically restarted after this operation is called. You can call the [DescribeParameterTemplates](https://help.aliyun.com/document_detail/67618.html) operation to query the parameters that take effect only after the instance is restarted.
 *
 * @param request ModifyParametersRequest
 * @return ModifyParametersResponse
 */
async function modifyParameters(request: ModifyParametersRequest): ModifyParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyParametersWithOptions(request, runtime);
}

model ModifyResourceGroupRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp1366caac83****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the region ID.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).

This parameter is required.', example='rg-acfmyiu4ekp****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='5DD0DEC3-24A1-5268-8E0B-5B264CA1****'),
}

model ModifyResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyResourceGroupResponseBody(name='body'),
}

/**
 * @summary Moves an ApsaraDB for MongoDB instance to a specified resource group.
 *
 * @description Resource Management allows you to build an organizational structure for resources based on your business requirements. You can use resource directories, folders, accounts, and resource groups to hierarchically organize and manage resources. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)
 *
 * @param request ModifyResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyResourceGroupResponse
 */
async function modifyResourceGroupWithOptions(request: ModifyResourceGroupRequest, runtime: Util.RuntimeOptions): ModifyResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyResourceGroup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Moves an ApsaraDB for MongoDB instance to a specified resource group.
 *
 * @description Resource Management allows you to build an organizational structure for resources based on your business requirements. You can use resource directories, folders, accounts, and resource groups to hierarchically organize and manage resources. For more information, see [What is Resource Management?](https://help.aliyun.com/document_detail/94475.html)
 *
 * @param request ModifyResourceGroupRequest
 * @return ModifyResourceGroupResponse
 */
async function modifyResourceGroup(request: ModifyResourceGroupRequest): ModifyResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyResourceGroupWithOptions(request, runtime);
}

model ModifySecurityGroupConfigurationRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the ECS security group.

> * You can bind up to 10 ECS security groups to an ApsaraDB for MongoDB instance.
> * You can call the [DescribeSecurityGroup](https://help.aliyun.com/document_detail/25556.html) operation of ECS to query the security groups in the specified region.

This parameter is required.', example='sg-bpxxxxxxxx'),
}

model ModifySecurityGroupConfigurationResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='E062C482-1A4B-469E-938C-96D28CFAE42E'),
}

model ModifySecurityGroupConfigurationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityGroupConfigurationResponseBody(name='body'),
}

/**
 * @summary You can call this operation to modify an ECS Security group that is bound to an ApsaraDB for MongoDB instance.
 *
 * @description >  For a sharded cluster instance, the bound ECS security group takes effect only for mongos nodes.
 *
 * @param request ModifySecurityGroupConfigurationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityGroupConfigurationResponse
 */
async function modifySecurityGroupConfigurationWithOptions(request: ModifySecurityGroupConfigurationRequest, runtime: Util.RuntimeOptions): ModifySecurityGroupConfigurationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySecurityGroupConfiguration',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary You can call this operation to modify an ECS Security group that is bound to an ApsaraDB for MongoDB instance.
 *
 * @description >  For a sharded cluster instance, the bound ECS security group takes effect only for mongos nodes.
 *
 * @param request ModifySecurityGroupConfigurationRequest
 * @return ModifySecurityGroupConfigurationResponse
 */
async function modifySecurityGroupConfiguration(request: ModifySecurityGroupConfigurationRequest): ModifySecurityGroupConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityGroupConfigurationWithOptions(request, runtime);
}

model ModifySecurityIpsRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp*****'),
  modifyMode?: string(name='ModifyMode', description='The method that is used to modify the IP address whitelist. Valid values:

*   **Cover**: overwrites the original IP address whitelist.
*   **Append**: appends data to the IP address whitelist.
*   **Delete**: deletes the IP address whitelist.

Default value: **Cover**.', example='Append'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIpGroupAttribute?: string(name='SecurityIpGroupAttribute', description='The attribute of the IP address whitelist. It can contain a maximum of 120 characters in length and can contain uppercase letters, lowercase letters, and digits.

This parameter is empty by default.', example='test'),
  securityIpGroupName?: string(name='SecurityIpGroupName', description='The name of the IP address whitelist that you want to modify. Default value: **default**.', example='allowserver'),
  securityIps?: string(name='SecurityIps', description='The IP addresses in the IP address whitelist. Separate multiple IP addresses with commas (,). You can add a maximum of 1,000 different IP addresses to the IP address whitelist. The entries in the IP address whitelist must be in one of the following formats:

*   IP addresses, such as 127.0.0.1.
*   CIDR blocks, such as 127.0.0.1/24. In this example, 24 indicates that the prefix of each IP address in the IP address whitelist is 24 bits in length. You can replace 24 with a value within the range of 1 to 32.

This parameter is required.', example='127.0.0.1/24,127.0.0.1'),
}

model ModifySecurityIpsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='61B05CCF-EBAB-4BF3-BA67-D77256A721E2'),
}

model ModifySecurityIpsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityIpsResponseBody(name='body'),
}

/**
 * @summary Modifies the IP address whitelist of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifySecurityIpsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIpsWithOptions(request: ModifySecurityIpsRequest, runtime: Util.RuntimeOptions): ModifySecurityIpsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityIpGroupAttribute)) {
    query['SecurityIpGroupAttribute'] = request.securityIpGroupAttribute;
  }
  if (!Util.isUnset(request.securityIpGroupName)) {
    query['SecurityIpGroupName'] = request.securityIpGroupName;
  }
  if (!Util.isUnset(request.securityIps)) {
    query['SecurityIps'] = request.securityIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySecurityIps',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the IP address whitelist of an ApsaraDB for MongoDB instance.
 *
 * @param request ModifySecurityIpsRequest
 * @return ModifySecurityIpsResponse
 */
async function modifySecurityIps(request: ModifySecurityIpsRequest): ModifySecurityIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityIpsWithOptions(request, runtime);
}

model ModifyTaskInfoRequest {
  actionParams?: string(name='ActionParams', description='A action-related parameter. This parameter can be extended based on your business requirements. This parameter value varies with the value of the TaskAction parameter.', example='{\\\\"recoverMode\\\\":\\\\"immediate\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/61933.html) operation to query the region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  stepName?: string(name='StepName', description='The name of the step visible to the user.

This parameter is required.', example='exec_task'),
  taskAction?: string(name='TaskAction', description='The action name that corresponds to the state described in the actionInfo parameter of the [DescribeHistoryTasks](https://help.aliyun.com/document_detail/2639186.html) operation.

This parameter is required.', example='modifySwitchTime'),
  taskId?: string(name='TaskId', description='The task ID. Separate multiple IDs with commas (,). You can specify up to 10 task IDs.

This parameter is required.', example='t-83br18hlpdrw3uxxxx'),
}

model ModifyTaskInfoResponseBody = {
  errorCode?: string(name='ErrorCode', description='The error code for the failed task. It is the same as that of the ModifyTaskInfo operation.', example='""'),
  errorTaskId?: string(name='ErrorTaskId', description='The ID of the failed task. The operation returns results after a task fails.', example='""'),
  requestId?: string(name='RequestId', description='The request ID.', example='6163731A-XXXX-XXXX-B934-3388DE70C217'),
  successCount?: string(name='SuccessCount', description='The number of successful tasks.', example='1'),
}

model ModifyTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTaskInfoResponseBody(name='body'),
}

/**
 * @summary Modifies the information of a task in the task center for an ApsaraDB for MongoDB instance.
 *
 * @description The actions performed by this operation for a task vary based on the current state of the task. The supported actions for a task can be obtained from the value of the actionInfo parameter in the DescribeHistoryTasks operation.
 *
 * @param request ModifyTaskInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTaskInfoResponse
 */
async function modifyTaskInfoWithOptions(request: ModifyTaskInfoRequest, runtime: Util.RuntimeOptions): ModifyTaskInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.actionParams)) {
    query['ActionParams'] = request.actionParams;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.stepName)) {
    query['StepName'] = request.stepName;
  }
  if (!Util.isUnset(request.taskAction)) {
    query['TaskAction'] = request.taskAction;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTaskInfo',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the information of a task in the task center for an ApsaraDB for MongoDB instance.
 *
 * @description The actions performed by this operation for a task vary based on the current state of the task. The supported actions for a task can be obtained from the value of the actionInfo parameter in the DescribeHistoryTasks operation.
 *
 * @param request ModifyTaskInfoRequest
 * @return ModifyTaskInfoResponse
 */
async function modifyTaskInfo(request: ModifyTaskInfoRequest): ModifyTaskInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTaskInfoWithOptions(request, runtime);
}

model ReleaseNodePrivateNetworkAddressRequest {
  connectionType?: string(name='ConnectionType', description='The public endpoint type. Valid values:

*   **SRV**
*   **Normal**

>  This parameter is valid only when you want to release an SRV endpoint.', example='SRV'),
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the sharded cluster instance.

This parameter is required.', example='dds-bp1a7009eb24****'),
  networkType?: string(name='NetworkType', description='The network type of the internal endpoint. Valid values:

*   **VPC**: virtual private cloud (VPC).
*   **Classic**: classic network.

>  You can call the [DescribeShardingNetworkAddress](https://help.aliyun.com/document_detail/62135.html) operation to query the network type of the internal endpoint.', example='VPC'),
  nodeId?: string(name='NodeId', description='The ID of the shard or Configserver node.

>  You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the ID of the shard or Configserver node.

This parameter is required.', example='d-bp128a003436****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ReleaseNodePrivateNetworkAddressResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0FDDC511-7252-4A4A-ADDA-5CB1BF63873D'),
}

model ReleaseNodePrivateNetworkAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseNodePrivateNetworkAddressResponseBody(name='body'),
}

/**
 * @summary Releases the internal endpoint of a shard or Configserver node in a sharded cluster instance.
 *
 * @description *   This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](https://help.aliyun.com/document_detail/134067.html).
 * *   To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation.
 *
 * @param request ReleaseNodePrivateNetworkAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseNodePrivateNetworkAddressResponse
 */
async function releaseNodePrivateNetworkAddressWithOptions(request: ReleaseNodePrivateNetworkAddressRequest, runtime: Util.RuntimeOptions): ReleaseNodePrivateNetworkAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionType)) {
    query['ConnectionType'] = request.connectionType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.networkType)) {
    query['NetworkType'] = request.networkType;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseNodePrivateNetworkAddress',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases the internal endpoint of a shard or Configserver node in a sharded cluster instance.
 *
 * @description *   This operation can be used to release the internal endpoint of a shard or Configserver node in a sharded cluster instance. For more information, see [Release the endpoint of a shard or Configserver node](https://help.aliyun.com/document_detail/134067.html).
 * *   To release the public endpoint of a shard or Configserver node in a sharded cluster instance, you can call the [ReleasePublicNetworkAddress](https://help.aliyun.com/document_detail/67604.html) operation.
 *
 * @param request ReleaseNodePrivateNetworkAddressRequest
 * @return ReleaseNodePrivateNetworkAddressResponse
 */
async function releaseNodePrivateNetworkAddress(request: ReleaseNodePrivateNetworkAddressRequest): ReleaseNodePrivateNetworkAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseNodePrivateNetworkAddressWithOptions(request, runtime);
}

model ReleasePublicNetworkAddressRequest {
  connectionType?: string(name='ConnectionType', description='The public endpoint type. Valid values:

*   **SRV**
*   **Normal**

>  This parameter is valid only when you want to release an SRV endpoint.', example='SRV'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bp2235****'),
  nodeId?: string(name='NodeId', description='The ID of the mongos, shard, or Configserver node in the sharded cluster instance.

> *   This parameter is valid only if you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.
> *   You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to view the ID of the mongos, shard, or Configserver node.', example='s-bp2235****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ReleasePublicNetworkAddressResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1D6AFE36-1AF5-4DE4-A954-672159D4CC69'),
}

model ReleasePublicNetworkAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleasePublicNetworkAddressResponseBody(name='body'),
}

/**
 * @summary Releases the public endpoint of an ApsaraDB for MongoDB instance.
 *
 * @param request ReleasePublicNetworkAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleasePublicNetworkAddressResponse
 */
async function releasePublicNetworkAddressWithOptions(request: ReleasePublicNetworkAddressRequest, runtime: Util.RuntimeOptions): ReleasePublicNetworkAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionType)) {
    query['ConnectionType'] = request.connectionType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleasePublicNetworkAddress',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases the public endpoint of an ApsaraDB for MongoDB instance.
 *
 * @param request ReleasePublicNetworkAddressRequest
 * @return ReleasePublicNetworkAddressResponse
 */
async function releasePublicNetworkAddress(request: ReleasePublicNetworkAddressRequest): ReleasePublicNetworkAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return releasePublicNetworkAddressWithOptions(request, runtime);
}

model RenewDBInstanceRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**: enables automatic payment. Make sure that you have sufficient balance within your account.
*   **false**: disables automatic payment. You must perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner, click **Expenses** and select **User Center** from the drop-down list. The User Center page appears. In the left-side navigation pane, choose **Order Management** > Renew. On the Renewal tab, find the bill that you want to pay and then click Renew in the Actions column.

Default value: **true**.', example='true'),
  autoRenew?: boolean(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false**

Default value: **false**.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information.', example='{“ActivityId":"000000000"}'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='ETnLKlblzczshOTUbOCzxxxxxxxxxx'),
  couponNo?: string(name='CouponNo', description='Specifies whether to use coupons. Default value: null. Valid values:

*   **default** or **null**: uses coupons.
*   **youhuiquan_promotion_option_id_for_blank**: does not use coupons.', example='1111111111111111'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period', description='The subscription period of the instance. Unit: month. Valid values: **1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, and 36**.

This parameter is required.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RenewDBInstanceResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='203317xxxxxxxx'),
  requestId?: string(name='RequestId', description='The request ID.', example='B118EF45-9633-4EE3-8405-42ED4373721B'),
}

model RenewDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RenewDBInstanceResponseBody(name='body'),
}

/**
 * @summary Manually renews an ApsaraDB for MongoDB subscription instance.
 *
 * @description Make sure that you fully understand the billing methods and pricing of ApsaraDB for MongoDB before you call this operation. For more information about the pricing of ApsaraDB for MongoDB, visit the [pricing tab of the product buy page](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * This operation is only applicable to instances that use the subscription billing method.
 *
 * @param request RenewDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RenewDBInstanceResponse
 */
async function renewDBInstanceWithOptions(request: RenewDBInstanceRequest, runtime: Util.RuntimeOptions): RenewDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RenewDBInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Manually renews an ApsaraDB for MongoDB subscription instance.
 *
 * @description Make sure that you fully understand the billing methods and pricing of ApsaraDB for MongoDB before you call this operation. For more information about the pricing of ApsaraDB for MongoDB, visit the [pricing tab of the product buy page](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * This operation is only applicable to instances that use the subscription billing method.
 *
 * @param request RenewDBInstanceRequest
 * @return RenewDBInstanceResponse
 */
async function renewDBInstance(request: RenewDBInstanceRequest): RenewDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewDBInstanceWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The account whose password needs to be reset. Set the value to **root**.

This parameter is required.', example='root'),
  accountPassword?: string(name='AccountPassword', description='The new password.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters include `! # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Ali!123456'),
  characterType?: string(name='CharacterType', description='The role of the instance.

*   If the instance is a sharded cluster instance, this parameter is required. Valid values: db and cs.
*   If the instance is a replica set instance, you can leave this parameter empty or set the parameter to normal.', example='db'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='06CBD06E-ABC9-4121-AB93-3C3820B3E7E6'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password of the root account in an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation can be used to reset only the password of the root account of an instance.
 *
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.characterType)) {
    query['CharacterType'] = request.characterType;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAccountPassword',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resets the password of the root account in an ApsaraDB for MongoDB instance.
 *
 * @description >  This operation can be used to reset only the password of the root account of an instance.
 *
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RestartDBInstanceRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the shard or mongos node in the sharded cluster instance.

> The sharded cluster instance is restarted if you do not specify this parameter.', example='d-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RestartDBInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='149C517D-B586-47BE-A107-8673E0ED77C6'),
}

model RestartDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartDBInstanceResponseBody(name='body'),
}

/**
 * @summary Restarts an ApsaraDB for MongoDB instance.
 *
 * @description This operation can also be used to restart an instance, or restart a shard or mongos node in a sharded cluster instance.
 *
 * @param request RestartDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartDBInstanceResponse
 */
async function restartDBInstanceWithOptions(request: RestartDBInstanceRequest, runtime: Util.RuntimeOptions): RestartDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RestartDBInstance',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts an ApsaraDB for MongoDB instance.
 *
 * @description This operation can also be used to restart an instance, or restart a shard or mongos node in a sharded cluster instance.
 *
 * @param request RestartDBInstanceRequest
 * @return RestartDBInstanceResponse
 */
async function restartDBInstance(request: RestartDBInstanceRequest): RestartDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartDBInstanceWithOptions(request, runtime);
}

model RestartNodeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

>  If you set this parameter to the ID of a sharded cluster instance, you must also specify the **NodeId** parameter.

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the shard, mongos, or ConfigServer node in a child instance of the sharded cluster instance.

>  If you set the **DBInstanceId** parameter to the ID of a sharded cluster instance, you must specify this parameter.', example='d-bp128a003436****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleId?: string(name='RoleId', description='The role ID of the node.

1.  You can call the [DescribeReplicaSetRole](https://help.aliyun.com/document_detail/468469.html) operation to query the role ID of a node in a replica set instance.
2.  You can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/468472.html) operation to query the role ID of a node in a sharded cluster instance.

This parameter is required.', example='6025****'),
}

model RestartNodeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='ECBCA991-XXXX-XXXX-834C-B3E8007F33AA'),
}

model RestartNodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartNodeResponseBody(name='body'),
}

/**
 * @summary Restarts a node in an ApsaraDB for MongoDB instance.
 *
 * @description You can call this operation to restart a node in a replica set instance or a child instance in a sharded cluster instance.
 * >  When you call this operation, the instance must meet the following requirements:
 * *   The instance is in the Running state.
 * *   The instance is a replica set or sharded cluster instance of the standard edition.
 *
 * @param request RestartNodeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartNodeResponse
 */
async function restartNodeWithOptions(request: RestartNodeRequest, runtime: Util.RuntimeOptions): RestartNodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleId)) {
    query['RoleId'] = request.roleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RestartNode',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts a node in an ApsaraDB for MongoDB instance.
 *
 * @description You can call this operation to restart a node in a replica set instance or a child instance in a sharded cluster instance.
 * >  When you call this operation, the instance must meet the following requirements:
 * *   The instance is in the Running state.
 * *   The instance is a replica set or sharded cluster instance of the standard edition.
 *
 * @param request RestartNodeRequest
 * @return RestartNodeResponse
 */
async function restartNode(request: RestartNodeRequest): RestartNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartNodeWithOptions(request, runtime);
}

model SwitchDBInstanceHARequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance

This parameter is required.', example='dds-bpxxxxxxxx'),
  nodeId?: string(name='NodeId', description='The ID of the shard node in the sharded cluster instance.

> You must specify this parameter if you set the **DBInstanceId** parameter to the ID of a sharded cluster instance.', example='d-bpxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  roleIds?: string(name='RoleIds', description='The IDs of the roles who switch the primary and secondary nodes for the instance. You can call the [DescribeRoleZoneInfo](https://help.aliyun.com/document_detail/123802.html) operation to view the IDs and information of roles of nodes.

> 

*   Separate role IDs with commas (,). If this parameter is not specified, the primary and secondary nodes are switched.

*   If you set the **DBInstanceId** parameter to the ID of a sharded cluster instance, the roles who switch the primary and secondary nodes for the instance must belong to one shard node.', example='972xxxx,972xxxx'),
  switchMode?: int32(name='SwitchMode', description='The time when the primary and secondary nodes are switched. Valid values:

*   0: The primary and secondary nodes are immediately switched.
*   1: The primary and secondary nodes are switched during the O\\\\&M time period.', example='0'),
}

model SwitchDBInstanceHAResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='26BD4E5F-BDB4-47BA-B232-413AA78CFA8F'),
}

model SwitchDBInstanceHAResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SwitchDBInstanceHAResponseBody(name='body'),
}

/**
 * @summary Switches the primary and secondary nodes for an ApsaraDB for MongoDB instance.
 *
 * @description The instance must be running when you call this operation.
 * > 
 * *   This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances.
 * *   On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards.
 *
 * @param request SwitchDBInstanceHARequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SwitchDBInstanceHAResponse
 */
async function switchDBInstanceHAWithOptions(request: SwitchDBInstanceHARequest, runtime: Util.RuntimeOptions): SwitchDBInstanceHAResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.nodeId)) {
    query['NodeId'] = request.nodeId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.roleIds)) {
    query['RoleIds'] = request.roleIds;
  }
  if (!Util.isUnset(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SwitchDBInstanceHA',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Switches the primary and secondary nodes for an ApsaraDB for MongoDB instance.
 *
 * @description The instance must be running when you call this operation.
 * > 
 * *   This operation is applicable to replica set instances and sharded cluster instances, but cannot be performed on standalone instances.
 * *   On replica set instances, the switch is performed between instances. On sharded cluster instances, the switch is performed between shards.
 *
 * @param request SwitchDBInstanceHARequest
 * @return SwitchDBInstanceHAResponse
 */
async function switchDBInstanceHA(request: SwitchDBInstanceHARequest): SwitchDBInstanceHAResponse {
  var runtime = new Util.RuntimeOptions{};
  return switchDBInstanceHAWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmyiu4ekp****'),
  resourceId?: [ string ](name='ResourceId', description='The details of the tags bound to the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag.

N specifies the serial number of the tag. The following example shows how to calculate consumption intervals:

- **Tag.1.Key** specifies the key of the first tag.
- **Tag.2.Key** specifies the key of the second tag.

This parameter is required.', example='Development team'),
      value?: string(name='Value', description='The value of tag.

N specifies the serial number of the tag. The following example shows how to calculate consumption intervals:

- **Tag.1.Value** specifies the value of the first tag.
- **Tag.2.Value** specifies the value of the second tag.

This parameter is required.', example='MongoDB 4.0 environment'),
    }
  ](name='Tag', description='The tags that are attached to the resources.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0FDDC511-7252-4A4A-ADDA-5CB1BF63****'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Binds tags to ApsaraDB for MongoDB instances.
 *
 * @description If you have a large number of instances, you can create multiple tags, bind the tags to the instances, and filter the instances by tag.
 * *   A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can be mapped to the same value.
 * *   If the tag that you specify does not exist, this tag is automatically created and bound to the specified instance.
 * *   If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag.
 * *   You can bind up to 20 tags to each instance.
 * *   You can bind tags to up to 50 instances each time you call the operation.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Binds tags to ApsaraDB for MongoDB instances.
 *
 * @description If you have a large number of instances, you can create multiple tags, bind the tags to the instances, and filter the instances by tag.
 * *   A tag consists of a key and a value. Each key must be unique in a region for an Alibaba Cloud account. Different keys can be mapped to the same value.
 * *   If the tag that you specify does not exist, this tag is automatically created and bound to the specified instance.
 * *   If a tag that has the same key is already bound to the instance, the new tag overwrites the existing tag.
 * *   You can bind up to 20 tags to each instance.
 * *   You can bind tags to up to 50 instances each time you call the operation.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model TransferClusterBackupRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='dds-bp2235****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model TransferClusterBackupResponseBody = {
  alreadyDone?: string(name='AlreadyDone', description='Indicates whether the instance is switched to the cluster backup mode. If the value of this parameter is **1**, the instance is switched to the cluster backup mode.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='3C4A2494-85C4-45C5-93CF-548DB3375193'),
}

model TransferClusterBackupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransferClusterBackupResponseBody(name='body'),
}

/**
 * @summary Switches the backup mode of an ApsaraDB for MongoDB sharded cluster instance to the cluster backup mode. After the instance is switched to the cluster backup mode, the instance supports high-frequency backup.
 *
 * @description *   The instance is an ApsaraDB for MongoDB sharded cluster instance that runs MongoDB 4.4 or later and uses enhanced SSDs (ESSDs) to store data.
 * *   You can call the TransferClusterBackup operation only for instances that are created before October 19, 2023 to switch the instances to the cluster backup mode. Cloud disk-based sharded cluster instances that are created on or after October 19, 2023 are set to the cluster backup mode by default.
 *
 * @param request TransferClusterBackupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransferClusterBackupResponse
 */
async function transferClusterBackupWithOptions(request: TransferClusterBackupRequest, runtime: Util.RuntimeOptions): TransferClusterBackupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransferClusterBackup',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Switches the backup mode of an ApsaraDB for MongoDB sharded cluster instance to the cluster backup mode. After the instance is switched to the cluster backup mode, the instance supports high-frequency backup.
 *
 * @description *   The instance is an ApsaraDB for MongoDB sharded cluster instance that runs MongoDB 4.4 or later and uses enhanced SSDs (ESSDs) to store data.
 * *   You can call the TransferClusterBackup operation only for instances that are created before October 19, 2023 to switch the instances to the cluster backup mode. Cloud disk-based sharded cluster instances that are created on or after October 19, 2023 are set to the cluster backup mode by default.
 *
 * @param request TransferClusterBackupRequest
 * @return TransferClusterBackupResponse
 */
async function transferClusterBackup(request: TransferClusterBackupRequest): TransferClusterBackupResponse {
  var runtime = new Util.RuntimeOptions{};
  return transferClusterBackupWithOptions(request, runtime);
}

model TransformInstanceChargeTypeRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**
*   **false**

> Default value: **true**.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal. Valid values:

*   **true**
*   **false**

> Default value: **false**.', example='false'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **PrePaid:** subscription.
*   **PostPaid:** pay-as-you-go.

This parameter is required.', example='PrePaid'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='dds-2ze55b3ec56c****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The subscription duration of the instance. Unit: months. Valid values: **1, 2, 3, 4, 5, 6, 7, 8, 9******, **12**, **24**, and **36**.', example='1'),
  pricingCycle?: string(name='PricingCycle', description='实例付费时长单位
取值说明：
- **Month：** 月
-  **Year：** 年

默认值：Month', example='Month'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model TransformInstanceChargeTypeResponseBody = {
  orderId?: string(name='OrderId', description='The order ID.', example='21084641369****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D8F1D721-6439-4257-A89C-F1E8E9C9****'),
}

model TransformInstanceChargeTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransformInstanceChargeTypeResponseBody(name='body'),
}

/**
 * @summary Changes the billing method of an instance from pay-as-you-go to subscription or from subscription to pay-as-you-go.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB
 * Before you call this API operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   Your instance has no unpaid billing method change orders.
 * *   The instance type is available for purchase. For more information about unavailable instance types, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * > To change the billing method of an instance whose instance type is no longer available to purchase, call the [ModifyDBInstanceSpec](https://help.aliyun.com/document_detail/61816.html) or [ModifyNodeSpec](https://help.aliyun.com/document_detail/61923.html) operation to change the instance type first.
 *
 * @param request TransformInstanceChargeTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransformInstanceChargeTypeResponse
 */
async function transformInstanceChargeTypeWithOptions(request: TransformInstanceChargeTypeRequest, runtime: Util.RuntimeOptions): TransformInstanceChargeTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.pricingCycle)) {
    query['PricingCycle'] = request.pricingCycle;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransformInstanceChargeType',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the billing method of an instance from pay-as-you-go to subscription or from subscription to pay-as-you-go.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/product/apsaradb-for-mongodb/pricing) of ApsaraDB for MongoDB
 * Before you call this API operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is in the Running state.
 * *   Your instance has no unpaid billing method change orders.
 * *   The instance type is available for purchase. For more information about unavailable instance types, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * > To change the billing method of an instance whose instance type is no longer available to purchase, call the [ModifyDBInstanceSpec](https://help.aliyun.com/document_detail/61816.html) or [ModifyNodeSpec](https://help.aliyun.com/document_detail/61923.html) operation to change the instance type first.
 *
 * @param request TransformInstanceChargeTypeRequest
 * @return TransformInstanceChargeTypeResponse
 */
async function transformInstanceChargeType(request: TransformInstanceChargeTypeRequest): TransformInstanceChargeTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return transformInstanceChargeTypeWithOptions(request, runtime);
}

model TransformToPrePaidRequest {
  autoPay?: boolean(name='AutoPay', description='Specifies whether to enable automatic payment. Valid values:

*   **true**: enables automatic payment.
*   **false**: disables automatic payment. For more information, see [Renew an ApsaraDB for MongoDB subscription instance](https://help.aliyun.com/document_detail/85052.html).

>  Default value: **true**.', example='true'),
  autoRenew?: string(name='AutoRenew', description='Specifies whether to enable auto-renewal for the instance. Valid values:

*   **true**
*   **false**

>  Default value: **false**.', example='true'),
  businessInfo?: string(name='BusinessInfo', description='The business information. This is an additional parameter.', example='{“ActivityId":"000000000"}'),
  couponNo?: string(name='CouponNo', description='The coupon code. Default value: `youhuiquan_promotion_option_id_for_blank`.', example='youhuiquan_promotion_option_id_for_blank'),
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp1366caac83****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: long(name='Period', description='The subscription duration of the instance. Unit: months. Valid values: **1**, **2**, **3**, **4**, **5**, **6**, **7**, **8**, **9**, **12**, **24**, and **36**.

This parameter is required.', example='1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model TransformToPrePaidResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='21022019252****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2F42BB4E-461F-5B55-A37C-53B1141C****'),
}

model TransformToPrePaidResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransformToPrePaidResponseBody(name='body'),
}

/**
 * @summary Changes the billing method of an ApsaraDB for MongoDB instance from pay-as-you-go to subscription.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * A subscription instance cannot be changed to a pay-as-you-go instance. To avoid wasting resources, proceed with caution.
 * Before you call this API operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is in the running state.
 * *   The billing method of the instance is pay-as-you-go.
 * *   The instance has no unpaid subscription orders.
 * *   The instance type is available for purchase. For more information about unavailable instance types, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * >  To change the billing method of an instance whose instance type is no longer available to subscription, call the [ModifyDBInstanceSpec](https://help.aliyun.com/document_detail/61816.html) or [ModifyNodeSpec](https://help.aliyun.com/document_detail/61923.html) operation to first change the instance type.
 *
 * @param request TransformToPrePaidRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransformToPrePaidResponse
 */
async function transformToPrePaidWithOptions(request: TransformToPrePaidRequest, runtime: Util.RuntimeOptions): TransformToPrePaidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.autoRenew)) {
    query['AutoRenew'] = request.autoRenew;
  }
  if (!Util.isUnset(request.businessInfo)) {
    query['BusinessInfo'] = request.businessInfo;
  }
  if (!Util.isUnset(request.couponNo)) {
    query['CouponNo'] = request.couponNo;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransformToPrePaid',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the billing method of an ApsaraDB for MongoDB instance from pay-as-you-go to subscription.
 *
 * @description Before you call this operation, make sure that you understand the billing methods and [pricing](https://www.alibabacloud.com/zh/product/apsaradb-for-mongodb/pricing).
 * A subscription instance cannot be changed to a pay-as-you-go instance. To avoid wasting resources, proceed with caution.
 * Before you call this API operation, make sure that the ApsaraDB for MongoDB instance meets the following requirements:
 * *   The instance is in the running state.
 * *   The billing method of the instance is pay-as-you-go.
 * *   The instance has no unpaid subscription orders.
 * *   The instance type is available for purchase. For more information about unavailable instance types, see [Instance types](https://help.aliyun.com/document_detail/57141.html).
 * >  To change the billing method of an instance whose instance type is no longer available to subscription, call the [ModifyDBInstanceSpec](https://help.aliyun.com/document_detail/61816.html) or [ModifyNodeSpec](https://help.aliyun.com/document_detail/61923.html) operation to first change the instance type.
 *
 * @param request TransformToPrePaidRequest
 * @return TransformToPrePaidResponse
 */
async function transformToPrePaid(request: TransformToPrePaidRequest): TransformToPrePaidResponse {
  var runtime = new Util.RuntimeOptions{};
  return transformToPrePaidWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the instances. Valid values:

*   **true**: removes all tags from the instances.
*   **false**: does not remove all tags from the instances.

> 

*   Default value: **false**.

*   If you specify the **TagKey** parameter together with this parameter, this parameter does not take effect.', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the instance. You can call the [DescribeDBInstanceAttribute](https://help.aliyun.com/document_detail/62010.html) operation to query the region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='sg-bpxxxxxxxxxxxxxxxxxx'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs.

This parameter is required.', example='dds-bpxxxxxxxx'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **INSTANCE**.

This parameter is required.', example='INSTANCE'),
  tagKey?: [ string ](name='TagKey', description='The tag keys of the resource.'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='FA3A7F36-DB57-4281-8935-4B9DF61554EB'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes a tag if the tag is not added to another instance.
 *
 * @description > 
 * *   You can remove up to 20 tags at a time.
 * *   If you remove a tag from all instances, the tag is automatically deleted.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes a tag if the tag is not added to another instance.
 *
 * @description > 
 * *   You can remove up to 20 tags at a time.
 * *   If you remove a tag from all instances, the tag is automatically deleted.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpgradeDBInstanceEngineVersionRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bpxxxxxxxx'),
  engineVersion?: string(name='EngineVersion', description='The database version to which you want to upgrade. Valid values: **3.4**, **4.0**, and **4.2**.

>  This database version must be later than the current database version of the instance.

This parameter is required.', example='4.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchMode?: int32(name='SwitchMode', description='The time when to perform the upgrade. Valid values:

*   **0**: immediately performs the upgrade.
*   **1**: performs the upgrade during the maintenance window.', example='1'),
}

model UpgradeDBInstanceEngineVersionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='C4907B00-A208-4E0C-A636-AA85140E406C'),
}

model UpgradeDBInstanceEngineVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeDBInstanceEngineVersionResponseBody(name='body'),
}

/**
 * @summary Upgrades the database version of an ApsaraDB for MongoDB instance.
 *
 * @description The instance must be in the running state when you call this operation.
 * > * The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](https://help.aliyun.com/document_detail/398673.html). You can also call the [DescribeAvailableEngineVersion](https://help.aliyun.com/document_detail/141355.html) operation to query the available database versions.
 * > * You cannot downgrade the MongoDB version of an instance after you upgrade it.
 * > * The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during off-peak hours.
 *
 * @param request UpgradeDBInstanceEngineVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeDBInstanceEngineVersionResponse
 */
async function upgradeDBInstanceEngineVersionWithOptions(request: UpgradeDBInstanceEngineVersionRequest, runtime: Util.RuntimeOptions): UpgradeDBInstanceEngineVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeDBInstanceEngineVersion',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades the database version of an ApsaraDB for MongoDB instance.
 *
 * @description The instance must be in the running state when you call this operation.
 * > * The available database versions depend on the storage engine used by the instance. For more information, see [Upgrades of MongoDB major versions](https://help.aliyun.com/document_detail/398673.html). You can also call the [DescribeAvailableEngineVersion](https://help.aliyun.com/document_detail/141355.html) operation to query the available database versions.
 * > * You cannot downgrade the MongoDB version of an instance after you upgrade it.
 * > * The instance is automatically restarted for two to three times during the upgrade process. Make sure that you upgrade the instance during off-peak hours.
 *
 * @param request UpgradeDBInstanceEngineVersionRequest
 * @return UpgradeDBInstanceEngineVersionResponse
 */
async function upgradeDBInstanceEngineVersion(request: UpgradeDBInstanceEngineVersionRequest): UpgradeDBInstanceEngineVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBInstanceEngineVersionWithOptions(request, runtime);
}

model UpgradeDBInstanceKernelVersionRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The ID of the instance.

This parameter is required.', example='dds-bp2235****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchMode?: string(name='SwitchMode', description='The time when to perform the upgrade. Valid values:

*   **0**: immediately performs the upgrade.
*   **1**: performs the upgrade during the maintenance window.', example='1'),
}

model UpgradeDBInstanceKernelVersionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='27B9A130-7C4B-40D9-84E8-2FC081097AAC'),
}

model UpgradeDBInstanceKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeDBInstanceKernelVersionResponseBody(name='body'),
}

/**
 * @summary Upgrades the minor version of an ApsaraDB for MongoDB instance.
 *
 * @description When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state.
 * > * The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances.
 * > * The instance will be restarted once during the upgrade. Call this operation during off-peak hours.
 *
 * @param request UpgradeDBInstanceKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeDBInstanceKernelVersionResponse
 */
async function upgradeDBInstanceKernelVersionWithOptions(request: UpgradeDBInstanceKernelVersionRequest, runtime: Util.RuntimeOptions): UpgradeDBInstanceKernelVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeDBInstanceKernelVersion',
    version = '2015-12-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Upgrades the minor version of an ApsaraDB for MongoDB instance.
 *
 * @description When you call the UpgradeDBInstanceKernelVersion operation, the instance must be in the Running state.
 * > * The UpgradeDBInstanceKernelVersion operation is applicable to replica set and sharded cluster instances, but not to standalone instances.
 * > * The instance will be restarted once during the upgrade. Call this operation during off-peak hours.
 *
 * @param request UpgradeDBInstanceKernelVersionRequest
 * @return UpgradeDBInstanceKernelVersionResponse
 */
async function upgradeDBInstanceKernelVersion(request: UpgradeDBInstanceKernelVersionRequest): UpgradeDBInstanceKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBInstanceKernelVersionWithOptions(request, runtime);
}

